Download src/php/php-src/Zend/tests/autoload/bug78868.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 709 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/autoload/bug78868.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/autoload/bug78868.phpt
-
curl -L -o bug78868.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/autoload/bug78868.phpt
709 Bytes
| --TEST-- | |
| Bug #78868: Calling __autoload() with incorrect EG(fake_scope) value | |
| --FILE-- | |
| class C { | |
| private $private = 1; | |
| function foo() { | |
| $this->private++; //fails with EG(fake_scope) != NULL && EG(fake_scope) != "C" | |
| } | |
| } | |
| class A { | |
| static $foo = B::foo; //not resolved on include() | |
| } | |
| function main_autoload($class_name) { | |
| $c = new C; | |
| $c->foo(); | |
| //doesn't affect the error | |
| eval("class B {const foo = 1;}"); | |
| } | |
| spl_autoload_register('main_autoload'); | |
| $classA = new ReflectionClass("A"); | |
| $props = $classA->getProperties(); | |
| $props[0]->setValue(null, 2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A" | |
| echo "OK\n"; | |
| --EXPECT-- | |
| OK | |