Re: restore_error_handler() to default error handler
| From: | Michael Sims | Date: | Tue, 14 Jan 2003 13:38:32 +0000 |
| Subject: | Re: restore_error_handler() to default error handler | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131541@lists.php.net to get a copy of this message | ||
On Tue, 14 Jan 2003 01:20:54 -0700, you wrote:
>Hi,
>
>I was playing around with error handlers, and tried this:
[...]
>Which worked just fine. A little too good, in fact.
>
>I got over 1,200 emails in a matter of minutes (high traffic site).
I'm not sure whey restore_error_handler() isn't working, but I have
something else which may help you. When you use a custom error
handler your function will handle ALL errors, regardless of your
current error_reporting level. To make your function honor the
current error_reporting level, put this line at the top of your
function:
if (!($_ErrorNumber_ & error_reporting())) return;
This will also allow your function to ignore errors on function calls
that you have prefixed with an '@', since the '@' temporarily sets the
error_reporting level to 0.