Download src/php/php-src/Zend/tests/grammar/readonly_function.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 501 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/grammar/readonly_function.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/grammar/readonly_function.phpt
-
curl -L -o readonly_function.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/grammar/readonly_function.phpt
501 Bytes
| --TEST-- | |
| Can use readonly as a function name | |
| --FILE-- | |
| function readonly() { | |
| echo "Hi!\n"; | |
| } | |
| class A { | |
| const readonly = 'Const hi!'; | |
| static function readonly() { | |
| echo "Static hi!\n"; | |
| } | |
| } | |
| class B { | |
| public $readonly = 'Prop hi!'; | |
| function readonly() { | |
| echo "Instance hi!\n"; | |
| } | |
| } | |
| $b = new B(); | |
| readonly(); | |
| echo A::readonly, "\n"; | |
| A::readonly(); | |
| $b->readonly(); | |
| echo $b->readonly, "\n"; | |
| --EXPECT-- | |
| Hi! | |
| Const hi! | |
| Static hi! | |
| Instance hi! | |
| Prop hi! | |