php.net |  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
 [2020-01-28 16:25 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-28 16:51 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2020-01-28 16:51 UTC] nikic@php.net
Duplicate of bug #76535.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 17:01:24 2020 UTC