mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
40 lines
524 B
PHP
Executable File
40 lines
524 B
PHP
Executable File
--TEST--
|
|
Bug #35163.3 (Array elements can lose references)
|
|
--FILE--
|
|
<?php
|
|
$a = new stdClass;
|
|
$a->b = array(1);
|
|
$a->b[] =& $a->b;
|
|
$a->b[] =& $a->b;
|
|
$a->b[0] = 2;
|
|
var_dump($a);
|
|
$a->b = null;
|
|
$a = null;
|
|
?>
|
|
--EXPECT--
|
|
object(stdClass)#1 (1) {
|
|
["b"]=>
|
|
&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*
|
|
}
|
|
}
|
|
}
|