|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-12-13 07:32 UTC] ustimenko dot alexander at gmail dot com
[2020-12-23 12:08 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2020-12-23 12:08 UTC] cmb@php.net
[2020-12-23 12:16 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
[2020-12-23 12:29 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
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