php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66195 restore_error_handler() from the error_handler
Submitted: 2013-11-28 21:30 UTC Modified: 2013-12-04 12:06 UTC
From: david at grudl dot com Assigned: krakjoe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 17 = ?
Subscribe to this entry?

 
 [2013-11-28 21:30 UTC] david at grudl dot com
Description:
------------
In documentation http://us2.php.net/restore_error_handler is note:

> Calling restore_error_handler() from the error_handler function is ignored.

I've tried it in all PHP versions from 5.3.0 to 5.5.6 and it seems that it works and is not ignored.

Test script:
---------------
<?php

set_error_handler(function() {
	echo 'one';
});

set_error_handler(function() {
	echo 'two';
    restore_error_handler();
});

trigger_error('', E_USER_NOTICE);
trigger_error('', E_USER_NOTICE);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-04 12:06 UTC] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=332260
Log: fix #66195 restore error handler is not ignored (zend_builtin_functions.c#1570)
 [2013-12-04 12:06 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2013-12-04 12:06 UTC] krakjoe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=13bf1bc8f52ce8b4e26a2887313bcb3f1e00d36d
Log: fix #66195 restore error handler is not ignored (zend_builtin_functions.c#1570)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 13:01:27 2025 UTC