mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
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.
22 lines
406 B
PHP
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
|