Download src/php/php-src/Zend/tests/gc/bug63734.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 467 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/gc/bug63734.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/gc/bug63734.phpt
-
curl -L -o bug63734.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/gc/bug63734.phpt
467 Bytes
| --TEST-- | |
| Bug #63734 (Garbage collector can free zvals that are still referenced) | |
| --INI-- | |
| zend.enable_gc = 1 | |
| --FILE-- | |
| class C { | |
| public $ref; | |
| public $ary; | |
| public function __construct() { | |
| $this->ref = $this; | |
| $this->ary[] = 42; | |
| } | |
| public function __destruct() { | |
| global $ary; | |
| $ary[] = $this->ary[0]; | |
| } | |
| } | |
| $c = new C; | |
| unset($c); | |
| gc_collect_cycles(); | |
| var_dump($ary); | |
| --EXPECT-- | |
| array(1) { | |
| [0]=> | |
| int(42) | |
| } | |