Download src/php/php-src/Zend/tests/constexpr/new_static.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 288 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/constexpr/new_static.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/constexpr/new_static.phpt
-
curl -L -o new_static.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/constexpr/new_static.phpt
288 Bytes
| --TEST-- | |
| Static in new is supported | |
| --FILE-- | |
| class Foo { | |
| public static function singleton() { | |
| static $x = new static; | |
| return $x; | |
| } | |
| } | |
| $x = Foo::singleton(); | |
| $y = Foo::singleton(); | |
| var_dump($x, $y); | |
| --EXPECT-- | |
| object(Foo)#1 (0) { | |
| } | |
| object(Foo)#1 (0) { | |
| } | |