Download src/php/php-src/Zend/tests/anon/016.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 516 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/anon/016.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/anon/016.phpt
-
curl -L -o 016.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/anon/016.phpt
516 Bytes
| --TEST-- | |
| static variables in methods inherited from parent class (can't cache objects) | |
| --FILE-- | |
| class C { | |
| function foo ($y = null) { | |
| static $x = null; | |
| if (!is_null($y)) { | |
| $x = [$y]; | |
| } | |
| return $x; | |
| } | |
| } | |
| $c = new C(); | |
| $c->foo(new stdClass); | |
| $d = new class extends C {}; | |
| var_dump($d->foo()); | |
| var_dump($d->foo(24)); | |
| var_dump($c->foo()); | |
| --EXPECT-- | |
| array(1) { | |
| [0]=> | |
| object(stdClass)#2 (0) { | |
| } | |
| } | |
| array(1) { | |
| [0]=> | |
| int(24) | |
| } | |
| array(1) { | |
| [0]=> | |
| int(24) | |
| } | |