|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79184 include() after set_error_handler() with opcache on/off
Submitted: 2020-01-28 16:25 UTC Modified: 2020-01-28 16:51 UTC
From: x86xlat at gmail dot com Assigned:
Status: Duplicate Package: opcache
PHP Version: 7.4.2 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: x86xlat at gmail dot com
New email:
PHP Version: OS:


 [2020-01-28 16:25 UTC] x86xlat at gmail dot com
set_error_handler() seems to be ignored when using include() with opcache enabled.

Test script:
file a.php:
set_error_handler(function($errno, $errstr, $errfile, $errline) {
	throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);

file b.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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-28 16:51 UTC]
-Status: Open +Status: Duplicate
 [2020-01-28 16:51 UTC]
Duplicate of bug #76535.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 21:01:29 2024 UTC