mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
7aacc705d0
Closes GH-5958
34 lines
525 B
PHP
34 lines
525 B
PHP
--TEST--
|
|
Bug #69446 (GC leak relating to removal of nested data after dtors run)
|
|
--INI--
|
|
zend.enable_gc = 1
|
|
--FILE--
|
|
<?php
|
|
$bar = NULL;
|
|
class bad {
|
|
public function __destruct() {
|
|
global $bar;
|
|
$bar = $this;
|
|
$bar->y = new stdClass;
|
|
}
|
|
}
|
|
|
|
$foo = new stdClass;
|
|
$foo->foo = $foo;
|
|
$foo->bad = new bad;
|
|
$foo->bad->x = new stdClass;
|
|
|
|
unset($foo);
|
|
gc_collect_cycles();
|
|
var_dump($bar);
|
|
?>
|
|
--EXPECT--
|
|
object(bad)#2 (2) {
|
|
["x"]=>
|
|
object(stdClass)#3 (0) {
|
|
}
|
|
["y"]=>
|
|
object(stdClass)#4 (0) {
|
|
}
|
|
}
|