-
Posts
969 -
Joined
-
Last visited
Posts posted by Destramic
-
-
hey guys i read about being able to catch E_ERROR's using:
register_shutdown_function('fatal_error_catcher'); function fatal_error_catcher() { $last_error = error_get_last(); if ($last_error['type'] === E_ERROR) { print_r($last_error); } }
now I've tried to test it when triggering but it'll just show a warning message
trigger_error('test', E_ERROR);
my questions are
1. is it even possible to catch a fatal error?...as a fatal error would be caused by the PHP engine itself, which makes me think it wouldn't execute this error catcher?
2. or is it not catching because you can't manual trigger a E_ERROR.
some advise on this would be helpful thank you
fatal error handling
in PHP Coding Help
Posted
yeah i've used mine to catch exceptions also...although i do like the redirect to 500 error page if occurs...the problem is with my code is that when i try to get the last error
it returns nothing even when there's a error....any idea why?