mirror of
https://github.com/php/php-src.git
synced 2026-03-30 20:22:36 +02:00
From now on, we always display the given object's type instead of just reporting "object". Additionally, make the format of return type errors match the format of argument errors. Closes GH-5625
22 lines
404 B
PHP
22 lines
404 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 ($arg) must be of type array, ArrayObject given
|
|
Done
|