mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
42 lines
654 B
PHP
Executable File
42 lines
654 B
PHP
Executable File
--TEST--
|
|
Bug #35239 (Objects can lose references)
|
|
--FILE--
|
|
<?php
|
|
$a = new stdClass;
|
|
$a->x0 = new stdClass;
|
|
$a->x0->y0 = 'a';
|
|
$a->x0->y1 =& $a->x0;
|
|
$a->x0->y2 =& $a->x0;
|
|
$a->x0->y0 = 'b';
|
|
var_dump($a);
|
|
$a->x0->y1 = "ok\n";
|
|
echo $a->x0;
|
|
?>
|
|
--EXPECT--
|
|
object(stdClass)#1 (1) {
|
|
["x0"]=>
|
|
&object(stdClass)#2 (3) {
|
|
["y0"]=>
|
|
string(1) "b"
|
|
["y1"]=>
|
|
&object(stdClass)#2 (3) {
|
|
["y0"]=>
|
|
string(1) "b"
|
|
["y1"]=>
|
|
*RECURSION*
|
|
["y2"]=>
|
|
*RECURSION*
|
|
}
|
|
["y2"]=>
|
|
&object(stdClass)#2 (3) {
|
|
["y0"]=>
|
|
string(1) "b"
|
|
["y1"]=>
|
|
*RECURSION*
|
|
["y2"]=>
|
|
*RECURSION*
|
|
}
|
|
}
|
|
}
|
|
ok
|