note 44594 deleted from function.set-error-handler by cmb

From: Date: Sun, 13 Oct 2019 07:28:06 +0000
Subject: note 44594 deleted from function.set-error-handler by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-212586@lists.php.net to get a copy of this message
Note Submitter: Sukender ---- 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).

« previous php.notes (#212586) next »