Download src/php/php-src/Zend/tests/anon/008.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/anon/008.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/anon/008.phpt
-
curl -L -o 008.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/anon/008.phpt
476 Bytes
| --TEST-- | |
| testing static access for methods and properties in anon classes | |
| --FILE-- | |
| $anonClass = new class("cats", "dogs") { | |
| public static $foo; | |
| private static $bar; | |
| public function __construct($foo, $bar) { | |
| static::$foo = $foo; | |
| static::$bar = $bar; | |
| } | |
| public static function getBar() { | |
| return static::$bar; | |
| } | |
| }; | |
| var_dump($anonClass::$foo); | |
| var_dump($anonClass::getBar()); | |
| --EXPECT-- | |
| string(4) "cats" | |
| string(4) "dogs" | |