Bug #79184 [Opn->Dup]: include() after set_error_handler() with opcache on/off

From: Date: Tue, 28 Jan 2020 16:51:43 +0000
Subject: Bug #79184 [Opn->Dup]: include() after set_error_handler() with opcache on/off
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225202@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79184&edit=1 ID: 79184 Updated by: nikic@php.net Reported by: x86xlat at gmail dot com Summary: include() after set_error_handler() with opcache on/off -Status: Open +Status: Duplicate Type: Bug Package: opcache Operating System: linux PHP Version: 7.4.2 Block user comment: N Private report: N New Comment: Duplicate of bug #76535. Previous Comments: ------------------------------------------------------------------------ [2020-01-28 16:25:14] x86xlat at gmail dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79184&edit=1

« previous php.bugs (#225202) next »