summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/bug40191.phpt
blob: c1a0d6b6c36718e10ddf37fc67d2867284dad64b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--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