|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-11-25 11:11 UTC] dmitry@php.net
[2019-11-25 11:11 UTC] dmitry@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 14:00:01 2025 UTC |
Description: ------------ __autoload() may be called with wrong EG(fake_scope) value Test script: --------------- <?php 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', false); $classA = new ReflectionClass("A"); $props = $classA->getProperties(); $props[0]->setValue(2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A" echo "OK\n"; Expected result: ---------------- OK Actual result: -------------- PHP Fatal error: Uncaught Error: Cannot access private property C::$private in bug.php