1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/standard/tests/array/bug40191.phpt
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00

22 lines
399 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, object given
Done