note 49132 deleted from function.set-error-handler by derick
| From: | derick@php.net | Date: | Mon, 22 Aug 2005 09:07:15 +0000 |
| Subject: | note 49132 deleted from function.set-error-handler by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94019@lists.php.net to get a copy of this message | ||
Note Submitter:
----
In PHP5, you're able to set multiple error handlers to handle specific error types. However,
be careful when you set multiple error handlers, as they may turn off error handling for other error
types.
<?
// set the generic error handler
set_error_handler('generic_handler');
// this error handler will print out our form when the user makes a mistake, but now errors other
than E_USER_WARNING will use the default error handler, not generic_handler
set_error_handler('fix_form_handler', E_USER_WARNING);
// this sets things the way we want:
// fix_form_handler takes care of E_USER_WARNING
// generic_handler takes care of all other error types
set_error_handler('generic_handler', E_ALL | E_USER_WARNING);
?>