xref: /PHP-5.4/ext/standard/tests/array/bug40191.phpt (revision 42feeddd)
1--TEST--
2Bug #40191 (use of array_unique() with objects triggers segfault)
3--SKIPIF--
4<?php if (!extension_loaded('spl')) die("skip SPL is not available"); ?>
5--FILE--
6<?php
7
8$arrObj = new ArrayObject();
9$arrObj->append('foo');
10$arrObj->append('bar');
11$arrObj->append('foo');
12
13$arr = array_unique($arrObj);
14var_dump($arr);
15
16echo "Done\n";
17?>
18--EXPECTF--
19Warning: array_unique() expects parameter 1 to be array, object given in %s on line %d
20NULL
21Done
22