Bug #73665 [Opn->Ver]: set_error_handler cant't listen E_Deprecated when opcache loaded

From: Date: Sun, 19 Feb 2017 10:42:02 +0000
Subject: Bug #73665 [Opn->Ver]: set_error_handler cant't listen E_Deprecated when opcache loaded
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207443@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73665&edit=1 ID: 73665 Updated by: cmb@php.net Reported by: lcx165 at gmail dot com Summary: set_error_handler cant't listen E_Deprecated when opcache loaded -Status: Open +Status: Verified Type: Bug Package: opcache Operating System: Linux 64bit NTS PHP Version: 7.0.13 Block user comment: N Private report: N New Comment: The expected and actual results above are swapped, but otherwise I can reproduce this at least for the first page request. Previous Comments: ------------------------------------------------------------------------ [2016-12-06 09:36:03] lcx165 at gmail dot com Description: ------------ When opcache.so loaded,use set_error_handler function listen all error. When E_Deprecated happened, can't call error_handler function, use php system error display. Test script: --------------- //a.php <?php class A { //E_Deprecated function a() { } } //error.php <?php error_reporting(E_ALL); set_error_handler(function($code, $msg, $file, $line) { echo "[{$code}] {$msg}\r\n"; }); //NOTICE echo $a; //E_Deprecated include 'a.php'; //run as cli: php error.php Expected result: ---------------- [8] Undefined variable: a PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in /root/a.php on line 3 Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in /root/a.php on line 3 Actual result: -------------- [8] Undefined variable: a [8192] Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73665&edit=1

« previous php.bugs (#207443) next »