1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/standard/tests/array/bug40191.phpt
Tyson Andre 1e9a5c67ef Rename standard array function parameters to $array
This is targeting 8.0.

`$arg` seems like a poor choice of a name,
especially if the function were to have arguments added.

In many cases, the php.net documentation already has $array for these functions.
E.g. https://www.php.net/manual/en/function.array-intersect.php

I'd assume that since named arguments was added to 8.0 near the feature freeze,
PHP's maintainers had planned to make the names consistent
and gradually use the same name for  docs and implementation.
2020-08-11 19:11:59 -04:00

22 lines
406 B
PHP

--TEST--
Bug #40191 (use of array_unique() with objects triggers segfault)
--FILE--
<?php
$arrObj = new ArrayObject();
$arrObj->append('foo');
$arrObj->append('bar');
$arrObj->append('foo');
try {
$arr = array_unique($arrObj);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
array_unique(): Argument #1 ($array) must be of type array, ArrayObject given
Done