Bug #75542 [Com]: class not found without opcache loaded

From: Date: Wed, 13 Dec 2017 07:32:47 +0000
Subject: Bug #75542 [Com]: class not found without opcache loaded
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213076@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75542&edit=1 ID: 75542 Comment by: ustimenko dot alexander at gmail dot com Reported by: spam2 at rhsoft dot net Summary: class not found without opcache loaded Status: Open Type: Bug Package: Scripting Engine problem PHP Version: 7.2Git-2017-11-20 (Git) Block user comment: N Private report: N New Comment: Seems to repeats under PHP 7.1.12 (cli) Previous Comments: ------------------------------------------------------------------------ [2017-11-20 13:29:00] spam2 at rhsoft dot net 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 this bug report at https://bugs.php.net/bug.php?id=75542&edit=1

« previous php.bugs (#213076) next »