Download src/php/php-src/Zend/tests/attributes/028_grouped.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/attributes/028_grouped.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/attributes/028_grouped.phpt
-
curl -L -o 028_grouped.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/attributes/028_grouped.phpt
726 Bytes
| --TEST-- | |
| Attributes can be grouped | |
| --FILE-- | |
| (1), (2), (3) | |
| class Foo | |
| { | |
| } | |
| A1(1), | |
| (2), | |
| (3) | |
| function foo() {} | |
| , , | |
| function bar() {} | |
| $sources = [ | |
| new \ReflectionClass(Foo::class), | |
| new \ReflectionFunction('foo'), | |
| new \ReflectionFunction('bar'), | |
| ]; | |
| foreach ($sources as $ref) { | |
| $attr = $ref->getAttributes(); | |
| var_dump(get_class($ref), count($attr)); | |
| foreach ($attr as $a) { | |
| printf("%s(%s)\n", $a->getName(), implode(", ", $a->getArguments())); | |
| } | |
| echo "\n"; | |
| } | |
| --EXPECT-- | |
| string(15) "ReflectionClass" | |
| int(3) | |
| A1(1) | |
| A1(2) | |
| A2(3) | |
| string(18) "ReflectionFunction" | |
| int(3) | |
| A1(1) | |
| A1(2) | |
| A2(3) | |
| string(18) "ReflectionFunction" | |
| int(3) | |
| A1() | |
| A1() | |
| A2() | |