Download src/php/php-src/Zend/tests/enum/case-attributes.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/enum/case-attributes.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/enum/case-attributes.phpt
-
curl -L -o case-attributes.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/enum/case-attributes.phpt
457 Bytes
| --TEST-- | |
| Enum case attributes | |
| --FILE-- | |
| (Attribute::TARGET_CLASS_CONSTANT) | |
| class EnumCaseAttribute { | |
| public function __construct( | |
| public string $value, | |
| ) {} | |
| } | |
| enum Foo { | |
| ('Bar') | |
| case Bar; | |
| } | |
| var_dump((new \ReflectionClassConstant(Foo::class, 'Bar'))->getAttributes(EnumCaseAttribute::class)[0]->newInstance()); | |
| --EXPECT-- | |
| object(EnumCaseAttribute)#1 (1) { | |
| ["value"]=> | |
| string(3) "Bar" | |
| } | |