Bug #78881 [NEW]: "Can't preload unlinked class" if class extends Exception
| From: | mlocati at gmail dot com | Date: | Thu, 28 Nov 2019 17:51:06 +0000 |
| Subject: | Bug #78881 [NEW]: "Can't preload unlinked class" if class extends Exception | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223920@lists.php.net to get a copy of this message | ||
From: mlocati at gmail dot com
Operating system: Windows
PHP version: 7.4.0
Package: opcache
Bug Type: Bug
Bug description:"Can't preload unlinked class" if class extends Exception
Description:
------------
I have this file, saved as J:\tmp\MyException.php
<?php
class MyException extends Exception {}
I have this file, saved as J:\tmp\preload.php
<?php
opcache_compile_file('J:\\tmp\\MyException.php');
I have this file, saved as J:\tmp\php.ini:
log_errors = On
display_startup_errors = On
extension_dir=C:\Dev\PHP7.4\ext
zend_extension=opcache
opcache.enable_cli=1
opcache.preload=J:\tmp\preload.php
I have downloaded PHP 7.4.0 for Windows, 32 bits, thread safe, to
C:\Dev\PHP7.4
If I run this command from the Windows terminal:
C:\Dev\PHP7.4\php.exe -c J:\tmp\php.ini -v
Here's the output:
PHP Warning: Can't preload unlinked class MyException: Unknown reason
in J:\tmp\MyException.php on line 2
Warning: Can't preload unlinked class MyException: Unknown reason in
J:\tmp\MyException.php on line 2
PHP 7.4.0 (cli) (built: Nov 27 2019 10:15:52) ( ZTS Visual C++ 2017 x86
)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
If I edit the J:\tmp\MyException.php, removing "extends Exception", the
output is:
PHP 7.4.0 (cli) (built: Nov 27 2019 10:15:52) ( ZTS Visual C++ 2017 x86
)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
So, it seems that preload doesn't work if a class extends Exception...
--
Edit bug report at https://bugs.php.net/bug.php?id=78881&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78881&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78881&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78881&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78881&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78881&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78881&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78881&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78881&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78881&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78881&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78881&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78881&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78881&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78881&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78881&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78881&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78881&r=mysqlcfg