xref: /PHP-8.0/ext/standard/tests/array/bug40191.phpt (revision 1e9a5c67)
1--TEST--
2Bug #40191 (use of array_unique() with objects triggers segfault)
3--FILE--
4<?php
5
6$arrObj = new ArrayObject();
7$arrObj->append('foo');
8$arrObj->append('bar');
9$arrObj->append('foo');
10
11try {
12    $arr = array_unique($arrObj);
13} catch (TypeError $e) {
14    echo $e->getMessage(), "\n";
15}
16
17echo "Done\n";
18?>
19--EXPECT--
20array_unique(): Argument #1 ($array) must be of type array, ArrayObject given
21Done
22