Download src/php/php-src/ext/reflection/tests/ReflectionClassConstant_getValue.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 769 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/reflection/tests/ReflectionClassConstant_getValue.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/reflection/tests/ReflectionClassConstant_getValue.phpt
-
curl -L -o ReflectionClassConstant_getValue.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/reflection/tests/ReflectionClassConstant_getValue.phpt
769 Bytes
| --TEST-- | |
| Test variations of getting constant values | |
| --FILE-- | |
| /* Use separate classes to make sure that in-place constant updates don't interfere */ | |
| class A { | |
| const X = self::Y * 2; | |
| const Y = 1; | |
| } | |
| class B { | |
| const X = self::Y * 2; | |
| const Y = 1; | |
| } | |
| class C { | |
| const X = self::Y * 2; | |
| const Y = 1; | |
| } | |
| var_dump((new ReflectionClassConstant('A', 'X'))->getValue()); | |
| echo new ReflectionClassConstant('B', 'X'); | |
| echo new ReflectionClass('C'); | |
| --EXPECTF-- | |
| int(2) | |
| Constant [ public int X ] { 2 } | |
| Class [ <user> class C ] { | |
| @@ %s 12-15 | |
| - Constants [2] { | |
| Constant [ public int X ] { 2 } | |
| Constant [ public int Y ] { 1 } | |
| } | |
| - Static properties [0] { | |
| } | |
| - Static methods [0] { | |
| } | |
| - Properties [0] { | |
| } | |
| - Methods [0] { | |
| } | |
| } | |