xref: /PHP-8.4/ext/spl/tests/bug41691.phpt (revision f8d79582)
1--TEST--
2Bug #41691 (ArrayObject::exchangeArray hangs Apache)
3--FILE--
4<?php
5
6class A extends ArrayObject {
7    public function __construct($dummy, $flags) {
8        parent::__construct($this, $flags);
9    }
10    public $a;
11    public $b;
12    public $c;
13}
14
15$a = new A(null, ArrayObject::ARRAY_AS_PROPS );
16var_dump($a->exchangeArray(array('a'=>1,'b'=>1,'c'=>1)));
17
18echo "Done\n";
19?>
20--EXPECT--
21array(3) {
22  ["a"]=>
23  NULL
24  ["b"]=>
25  NULL
26  ["c"]=>
27  NULL
28}
29Done
30