Annotation of embedaddon/php/ext/standard/tests/array/bug40191.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #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);
! 14: var_dump($arr);
! 15:
! 16: echo "Done\n";
! 17: ?>
! 18: --EXPECTF--
! 19: Warning: array_unique() expects parameter 1 to be array, object given in %s on line %d
! 20: NULL
! 21: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>