Download src/php/php-src/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 644 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt
-
curl -L -o ReflectionClassConstant_unset_name.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt
644 Bytes
| --TEST-- | |
| Unsetting name on ReflectionClassConstant | |
| --FILE-- | |
| class Test { | |
| public const C = 1; | |
| } | |
| // This is unsupported and the actual behavior doesn't matter. | |
| // Just make sure it doesn't crash. | |
| $rc = new ReflectionClassConstant(Test::class, 'C'); | |
| unset($rc->name); | |
| try { | |
| var_dump($rc->getName()); | |
| } catch (Error $e) { | |
| echo $e->getMessage(), "\n"; | |
| } | |
| try { | |
| echo $rc, "\n"; | |
| } catch (Error $e) { | |
| echo $e->getMessage(), "\n"; | |
| } | |
| --EXPECT-- | |
| Typed property ReflectionClassConstant::$name must not be accessed before initialization | |
| Typed property ReflectionClassConstant::$name must not be accessed before initialization | |