Bug #79354 [NEW]: Fatal error: Anonymous class wasn't preloaded when using opcache preload
| From: | laurent35240 at gmail dot com | Date: | Sun, 08 Mar 2020 21:13:37 +0000 |
| Subject: | Bug #79354 [NEW]: Fatal error: Anonymous class wasn't preloaded when using opcache preload | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225954@lists.php.net to get a copy of this message | ||
From: laurent35240 at gmail dot com
Operating system: *nix
PHP version: 7.4.3
Package: opcache
Bug Type: Bug
Bug description:Fatal error: Anonymous class wasn't preloaded when using opcache preload
Description:
------------
When using opcache preload, I got this message when running my code
"Fatal error: Anonymous class wasn't preloaded"
This happens when there is usage of an anonymous class extending a class
that was not preloaded (cf test script)
I reproduced this issue with version 7.4.3 of PHP with cli and php-fpm
on Mac and Linux
Test script:
---------------
I tried to gather a test script here:
https://github.com/laurent35240/test-opcache-preload
Basically, you need to have a class using a anonymous class like in this
example
class A
{
public function getChildOfB() {
return new class () extends B {};
}
}
And put only class A and not class B in your opcache preload file.
Running a script calling A::getChildofB will then fail with a fatal
error.
Expected result:
----------------
No Fatal Error
Actual result:
--------------
Fatal error: Anonymous class wasn't preloaded
--
Edit bug report at https://bugs.php.net/bug.php?id=79354&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79354&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79354&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79354&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79354&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79354&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79354&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79354&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79354&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79354&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79354&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79354&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79354&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79354&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79354&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79354&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79354&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79354&r=mysqlcfg