Download src/php/php-src/Zend/tests/constants/class_constants_002.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/constants/class_constants_002.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/constants/class_constants_002.phpt
-
curl -L -o class_constants_002.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/constants/class_constants_002.phpt
437 Bytes
| --TEST-- | |
| class constants as default function arguments | |
| --FILE-- | |
| class test { | |
| const val = 1; | |
| } | |
| function foo($v = test::val) { | |
| var_dump($v); | |
| } | |
| function bar($b = NoSuchClass::val) { | |
| var_dump($b); | |
| } | |
| foo(); | |
| foo(5); | |
| bar(10); | |
| bar(); | |
| echo "Done\n"; | |
| --EXPECTF-- | |
| int(1) | |
| int(5) | |
| int(10) | |
| Fatal error: Uncaught Error: Class "NoSuchClass" not found in %s:%d | |
| Stack trace: | |
| #0 %s(%d): bar() | |
| #1 {main} | |
| thrown in %s on line %d | |