On Sun, 10 Nov 2002 10:48:46 -0500, you wrote:

>Hi Earnest. I found these user notes in the PHP manual, but, it's confusing
>and seems to be a bit contradictory:

It's simple:  A user defined error handler cannot handle parse errors
or compile time errors.  That makes sense to me...if your script
doesn't parse and can't complete the compile phase then how would you
expect your custom function to be able to handle the error?  It hasn't
been compiled yet...

>I just can't get this to
>work after having tried some other things I found online. All I want is for
>PHP to NOT report E_NOTICE errors, but, there seems to be no way to do this,
>even if I re-define the E_NOTICE constant vars.

The answer is in the editor's note that you quoted, two paragraphs
after you snipped the quote:

"if (!($type & error_reporting())) return;"

$type is the error code..i.e. the first parameter passed to your error
handler.  Add that line to the top of your error handling function and
it will behave the way you expect.

PHP's error reporting value is a bitmask...a combination of all of the
error type constants that you want PHP to report.  The line of code
above takes the current error's bit value and does a bitwise AND with
the error reporting level.  If the result is 0, that means that the
current error's bit value is not turned on in the current error
reporting level.  If this is so, then the line above will return from
your error handling function without doing anything...effectively
ignoring the error.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to