|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 26 22:03:33 2021 UTC