php - does set_error_handler catch errors that are not included into error_reporting() -
if exclude e_warning
errors error_reporting()
- error_reporting(e_all & ~e_warning)
custom error handler registered set_error_handler('error_handler')
called php warning errors?
i'm asking because there following code in kohana framework:
public static function error_handler($code, $error, $file = null, $line = null) { if (error_reporting() & $code) { // error not suppressed current error reporting settings // convert error errorexception throw new errorexception($error, $code, 0, $file, $line); } // not execute php error handler return true; }
which checks whether triggering function should processed if (error_reporting() & $code)
whereas expect function error_hanlder
never triggered errors shouldn't processed.
i guess i've found answer myself (from here):
it important remember standard php error handler bypassed error types specified error_types unless callback function returns false. error_reporting() settings have no effect , error handler called regardless - still able read current value of error_reporting , act appropriately. of particular note value 0 if statement caused error prepended @ error-control operator.
error_reporting() settings have no effect , error handler called regardless
Comments
Post a Comment