#35101 [Opn]: A custom handler set with set_error_handler() cannot be unset/removed
| From: | derick@php.net | Date: | Fri, 04 Nov 2005 08:16:36 +0000 |
| Subject: | #35101 [Opn]: A custom handler set with set_error_handler() cannot be unset/removed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-87550@lists.php.net to get a copy of this message | ||
ID: 35101
Updated by: derick@php.net
Reported By: mfischer@php.net
Status: Open
-Bug Type: Scripting Engine problem
+Bug Type: Feature/Change Request
Operating System: Any
-PHP Version: 5CVS-2005-11-04 (CVS)
+PHP Version: 6CVS
New Comment:
Nowhere it says that this is possible, thus marking it as a Feature
Request.
Previous Comments:
------------------------------------------------------------------------
[2005-11-04 09:13:35] mfischer@php.net
Description:
------------
A custom error handler set with set_error_handler() cannot be removed.
The documentation says that the return value of set_error_handler() is
the previous error handler. In case of no previous error handler, NULL
is returned.
However set_error_handler() cannot be called with NULL to restore the
PHP default error handler. This results in the following:
$ php -r 'set_error_handler(NULL);'
Warning: set_error_handler() expects argument 1, '', to be a valid
callback in Command line code on line 1
Reproduce code:
---------------
<?php
function handler() {
echo "called\n";
}
set_error_handler('handler called');
set_error_handler();
?>
Expected result:
----------------
Somehow a way for removing the current error handler and restoring the
original behaviour should be possible.
Actual result:
--------------
handler called
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35101&edit=1