Download src/php/php-src/Zend/tests/autoload/bug78921.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 895 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/autoload/bug78921.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/autoload/bug78921.phpt
-
curl -L -o bug78921.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/autoload/bug78921.phpt
895 Bytes
| --TEST-- | |
| Bug #78921: When Reflection triggers class load, property visibility is incorrect | |
| --FILE-- | |
| spl_autoload_register(function($className) { | |
| if ($className == 'PrivateStatic') { | |
| class PrivateStatic | |
| { | |
| const SOME_CONST = 13; | |
| private static $privateStaticVarArray = ['a', 'b', 'c']; | |
| private static $otherStatic; | |
| public static function init() | |
| { | |
| self::$otherStatic = self::$privateStaticVarArray; | |
| } | |
| } | |
| PrivateStatic::init(); | |
| } | |
| }); | |
| class OtherClass | |
| { | |
| const MY_CONST = PrivateStatic::SOME_CONST; | |
| public static $prop = 'my property'; | |
| } | |
| $reflectionClass = new ReflectionClass('OtherClass'); | |
| $reflectionProperty = $reflectionClass->getProperty('prop'); | |
| $value = $reflectionProperty->getValue(); | |
| echo "Value is $value\n"; | |
| --EXPECT-- | |
| Value is my property | |