Download src/php/php-src/Zend/tests/attributes/constants/repeatable-userland.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 570 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/attributes/constants/repeatable-userland.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/attributes/constants/repeatable-userland.phpt
-
curl -L -o repeatable-userland.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/attributes/constants/repeatable-userland.phpt
570 Bytes
| --TEST-- | |
| Validation of attribute repetition (is allowed; userland attribute) | |
| --FILE-- | |
| (Attribute::TARGET_ALL|Attribute::IS_REPEATABLE) | |
| class MyAttribute {} | |
| const MY_CONST = true; | |
| $attributes = new ReflectionConstant('MY_CONST')->getAttributes(); | |
| var_dump($attributes); | |
| $attributes[0]->newInstance(); | |
| --EXPECTF-- | |
| array(2) { | |
| [0]=> | |
| object(ReflectionAttribute)#%d (1) { | |
| ["name"]=> | |
| string(11) "MyAttribute" | |
| } | |
| [1]=> | |
| object(ReflectionAttribute)#%d (1) { | |
| ["name"]=> | |
| string(11) "MyAttribute" | |
| } | |
| } | |