note 44594 added to function.set-error-handler
| From: | Sukender at osu1 dot php dot net | Date: | Tue, 10 Aug 2004 15:29:47 +0000 |
| Subject: | note 44594 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74408@lists.php.net to get a copy of this message | ||
In PHP5, ou can ask for the default handler to be called after your custom handler by returning
"false". See this pseudo-code :
<?
function MyHandler($errno, $errstr, $errfile, $errline, $errcontext) {
my_handling_code; // Do something, such as sending an email to the admin
if (i_want_to_call_the_default_handler) return false; // will invoke the default error handler
just after
else return true; // This will NOT invoke it (= you've properly handled the error)
}
set_error_handler("MyHandler");
?>
I have not tested the functionality, but I think that the php.ini directive "log_errors"
keeps working, but *only* when you call the default handler (= retrun false).
>>> Source : Mailing list thread about "re-invoking default error handler" at
>>> http://www.zend.com/lists/php-dev/200405/msg00491.html (be careful
>>> about the first post : "true" and "false" are switched - because it's only
>>> a proposition).
----
Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44594
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44594&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44594&report=yes
Search -- http://master.php.net/manage/user-notes.php