mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
First pass at moving `Zend/tests/bug*` tests to existing sub directories Work towards GH-15631
35 lines
555 B
PHP
35 lines
555 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;
|
|
#[AllowDynamicProperties]
|
|
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);
|
|
?>
|
|
--EXPECTF--
|
|
object(bad)#%d (2) {
|
|
["x"]=>
|
|
object(stdClass)#%d (0) {
|
|
}
|
|
["y"]=>
|
|
object(stdClass)#%d (0) {
|
|
}
|
|
}
|