xref: /PHP-8.2/Zend/tests/bug35163_2.phpt (revision ae6f45ad)
1--TEST--
2Bug #35163.2 (Array elements can lose references)
3--FILE--
4<?php
5$a = array(1);
6$b = 'a';
7${$b}[] =& $$b;
8${$b}[] =& $$b;
9${$b}[0] = 2;
10var_dump($a);
11$a[0] = null;
12$a = null;
13?>
14--EXPECT--
15array(3) {
16  [0]=>
17  int(2)
18  [1]=>
19  *RECURSION*
20  [2]=>
21  *RECURSION*
22}
23