mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
25 lines
350 B
PHP
25 lines
350 B
PHP
--TEST--
|
|
GC 008: Unreferensed object cycle
|
|
--FILE--
|
|
<?php
|
|
$a = new stdClass();
|
|
$a->a = new stdClass();
|
|
$a->a->a = $a->a;
|
|
var_dump($a->a);
|
|
var_dump(gc_collect_cycles());
|
|
unset($a);
|
|
var_dump(gc_collect_cycles());
|
|
echo "ok\n"
|
|
?>
|
|
--EXPECT--
|
|
object(stdClass)#2 (1) {
|
|
["a"]=>
|
|
object(stdClass)#2 (1) {
|
|
["a"]=>
|
|
*RECURSION*
|
|
}
|
|
}
|
|
int(0)
|
|
int(1)
|
|
ok
|