xref: /PHP-8.1/Zend/tests/bug71539_1.phpt (revision fbca255c)
1--TEST--
2Bug #71539.1 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
3--FILE--
4<?php
5$x = (object)['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6,'g'=>7];
6$x->h =& $x->i;
7$x->h = 42;
8var_dump($x);
9?>
10--EXPECT--
11object(stdClass)#1 (9) {
12  ["a"]=>
13  int(1)
14  ["b"]=>
15  int(2)
16  ["c"]=>
17  int(3)
18  ["d"]=>
19  int(4)
20  ["e"]=>
21  int(5)
22  ["f"]=>
23  int(6)
24  ["g"]=>
25  int(7)
26  ["i"]=>
27  &int(42)
28  ["h"]=>
29  &int(42)
30}
31