mirror of
https://github.com/php/php-src.git
synced 2024-12-24 01:09:58 +08:00
37 lines
426 B
PHP
37 lines
426 B
PHP
--TEST--
|
|
Bug #35163.2 (Array elements can lose references)
|
|
--FILE--
|
|
<?php
|
|
$a = array(1);
|
|
$b = 'a';
|
|
${$b}[] =& $$b;
|
|
${$b}[] =& $$b;
|
|
${$b}[0] = 2;
|
|
var_dump($a);
|
|
$a[0] = null;
|
|
$a = null;
|
|
?>
|
|
--EXPECT--
|
|
array(3) {
|
|
[0]=>
|
|
int(2)
|
|
[1]=>
|
|
&array(3) {
|
|
[0]=>
|
|
int(2)
|
|
[1]=>
|
|
*RECURSION*
|
|
[2]=>
|
|
*RECURSION*
|
|
}
|
|
[2]=>
|
|
&array(3) {
|
|
[0]=>
|
|
int(2)
|
|
[1]=>
|
|
*RECURSION*
|
|
[2]=>
|
|
*RECURSION*
|
|
}
|
|
}
|