|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-01-28 16:51 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2020-01-28 16:51 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 14:00:01 2025 UTC |
Description: ------------ set_error_handler() seems to be ignored when using include() with opcache enabled. Test script: --------------- file a.php: <?php set_error_handler(function($errno, $errstr, $errfile, $errline) { throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); }); include('./b.php'); file b.php: <?php $t{0} = 0; Expected result: ---------------- $ php -d opcache.enable_cli=0 a.php PHP Fatal error: Uncaught ErrorException: Array and string offset access syntax with curly braces is deprecated in /opt/src/111/b.php:2 Stack trace: #0 /opt/src/111/a.php(5): {closure}(8192, 'Array and strin...', '/opt/src/111/b....', 2, Array) #1 /opt/src/111/a.php(5): include() #2 {main} thrown in /opt/src/111/b.php on line 2 And the same for -d opcache.enable_cli=1. Actual result: -------------- $ php -d opcache.enable_cli=1 a.php PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /opt/src/111/b.php on line 2