Bug #75542 [NEW]: class not found without opcache loaded
| From: | spam2 at rhsoft dot net | Date: | Mon, 20 Nov 2017 13:29:01 +0000 |
| Subject: | Bug #75542 [NEW]: class not found without opcache loaded | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212636@lists.php.net to get a copy of this message | ||
From: spam2 at rhsoft dot net
Operating system:
PHP version: 7.2Git-2017-11-20 (Git)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:class not found without opcache loaded
Description:
------------
harry@rh:/downloads]$ php test.php
Fatal error: Uncaught Error: Class 'B' not found in
/mnt/data/downloads/test.php:3
Stack trace:
#0 {main}
thrown in /mnt/data/downloads/test.php on line 3
____________________________
[harry@rh:/downloads]$ php-opcache test.php
bla
____________________________
[harry@rh:/downloads]$ cat test.php
<?php declare(strict_types=1);
echo (new B)->test('bla'), "\n";
class B extends A
{
public function test($input): string
{
return parent::test($input);
}
}
class A
{
public function test(string $input): string
{
return $input;
}
}
Test script:
---------------
[harry@rh:/downloads]$ cat test.php
<?php declare(strict_types=1);
echo (new B)->test('bla'), "\n";
class B extends A
{
public function test($input): string
{
return parent::test($input);
}
}
class A
{
public function test(string $input): string
{
return $input;
}
}
Expected result:
----------------
this is a major bug - the class at bottom defined in the same file is
explected to be found without opcache loaded
[harry@rh:/downloads]$ which php
/usr/bin/php
[harry@rh:/downloads]$ which php-opcache
alias php-opcache='/usr/bin/php -d "zend_extension=opcache.so" -d
"opcache.enable_cli=1"'
/usr/bin/php
Actual result:
--------------
class only found when opcache is loaded
--
Edit bug report at https://bugs.php.net/bug.php?id=75542&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75542&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75542&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75542&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75542&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75542&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75542&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75542&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75542&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75542&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75542&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75542&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75542&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75542&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75542&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75542&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75542&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75542&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75542&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75542&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75542&r=mysqlcfg