php-src/Zend/tests/bug69446.phpt

35 lines
551 B
Plaintext
Raw Normal View History

--TEST--
Bug #69446 (GC leak relating to removal of nested data after dtors run)
2017-01-11 01:17:31 +08:00
--INI--
zend.enable_gc = 1
--FILE--
<?php
$bar = NULL;
#[AllowDynamicProperties]
class bad {
2020-02-04 05:52:20 +08:00
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) {
}
}