Bug #78935 [NEW]: Preloading removes classes that have dependencies

From: Date: Mon, 09 Dec 2019 11:10:28 +0000
Subject: Bug #78935 [NEW]: Preloading removes classes that have dependencies
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224167@lists.php.net to get a copy of this message
From: nikic Operating system: PHP version: 7.4.0 Package: opcache Bug Type: Bug Bug description:Preloading removes classes that have dependencies Description: ------------ php -d opcache.preload=preload.php script.php preload.php: <?php class A { const C = UNRESOLVED; } class B extends A { const C = 42; } script.php: <?php var_dump(class_exists(A::class)); var_dump((new ReflectionClass(B::class))->getParentClass()->newInstance()); Class A will be removed from the preload state because it has unresolved initializers. However in the meantime B has already been linked, which is preloaded. The end result is that class B has a missing parent class when preloaded. -- Edit bug report at https://bugs.php.net/bug.php?id=78935&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78935&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78935&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78935&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78935&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78935&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78935&r=support Expected behavior: https://bugs.php.net/fix.php?id=78935&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78935&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78935&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78935&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78935&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78935&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78935&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78935&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78935&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78935&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78935&r=mysqlcfg

« previous php.bugs (#224167) next »