Bug #63206 [Com]: restore_error_handler does not restore previous errors mask

From: Date: Fri, 03 Jun 2016 14:31:35 +0000
Subject: Bug #63206 [Com]: restore_error_handler does not restore previous errors mask
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201429@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63206&edit=1 ID: 63206 Comment by: a at ustimen dot co Reported by: gwarnants at gmail dot com Summary: restore_error_handler does not restore previous errors mask Status: Open Type: Bug Package: *General Issues Operating System: Windows XP PHP Version: 5.4.7 Block user comment: N Private report: N New Comment: Sorry, my bad -- test script was not robust. Currently it repeats at PHP from 5.2 to nightly (7.x). Only under hhvm not repeats. https://travis-ci.org/garex/php-error-handler-bug/builds/135038478 Previous Comments: ------------------------------------------------------------------------ [2016-06-03 14:06:57] a at ustimen dot co Currently repeats at 5.4, 5.5 and 5.6 Seems fixed in 7.0, hhvm and nightly. https://travis-ci.org/garex/php-error-handler-bug ------------------------------------------------------------------------ [2016-01-14 02:38:31] hujuice at inserviblie dot org Same here for PHP 5.6.14 on Linux ------------------------------------------------------------------------ [2013-10-06 06:55:51] gwarnants at gmail dot com Same problem in 5.3.4 on Windows ------------------------------------------------------------------------ [2013-01-02 14:14:41] joe dot bowman at edigitalresearch dot com Same problem in 5.4.8 on CentOS 6.3. ------------------------------------------------------------------------ [2012-11-15 08:57:23] gwarnants at gmail dot com Here is a simpler example to illustrate the problem. As you see, the 2nd trigger_error will not be caught because the error reporting isn't restored to its initial state. set_error_handler('handler1', E_ALL); trigger_error('notice 1', E_USER_NOTICE); // OK trigger_error('notice 2', E_USER_NOTICE); // not caught ! function handler1($errrno, $errstr) { echo "HANDLER1 : $errstr\n"; set_error_handler('handler2', E_USER_WARNING); restore_error_handler(); } function handler2($errrno, $errstr) { } ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=63206 -- Edit this bug report at https://bugs.php.net/bug.php?id=63206&edit=1

« previous php.bugs (#201429) next »