I can use set_error_handler() to catch most PHP errors, but it doesn\'t work for fatal (E_ERROR) errors, such as calling a function that doesn\'t e
set_error_handler()
E_ERROR
If you are using PHP >= 5.1.0 Just do something like this with the ErrorException class: