The Plankmeister wrote:[color=blue]
> error_reporting (E_ERROR | E_WARNING);
> set_error_handl er("my_error_ha ndler");[/color]
[color=blue]
> But it still traps E_NOTICE errors... Most peculiar. What's going on?[/color]
When you define a error_handler, your function will trap _all_ errors no
matter what error_reporting has.
You may, however, filter the errors you want to deal with:
#v+
<?php
function my_error_handle r($err_no, $err_str, $file, $line) {
if ($err_no == E_NOTICE) {
// do nothing and
return;
}
// ... deal with other errors
exit("$err_no, $err_str in $file:$line\n") ;
}
Comment