Download src/php/php-src/Zend/tests/gc/bug69446.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/gc/bug69446.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/gc/bug69446.phpt
-
curl -L -o bug69446.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/gc/bug69446.phpt
555 Bytes
| --TEST-- | |
| Bug #69446 (GC leak relating to removal of nested data after dtors run) | |
| --INI-- | |
| zend.enable_gc = 1 | |
| --FILE-- | |
| $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); | |
| --EXPECTF-- | |
| object(bad)#%d (2) { | |
| ["x"]=> | |
| object(stdClass)#%d (0) { | |
| } | |
| ["y"]=> | |
| object(stdClass)#%d (0) { | |
| } | |
| } | |