ID:               35101
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 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] [EMAIL PROTECTED]

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

Reply via email to