PHP 5 Exception recovery

Can you resume execution after an uncaught exception is picked up by the customized exception handler?

For example, in my error class:


If I have code that throws an exception which is not caught, userExceptionHandler() catches and handles it.  Can I recover from there?
LVL 51
Steve BinkAsked:
Who is Participating?
hernst42Connect With a Mentor Commented:
No, if the exception is handled by the global exception handler The script finish after that point. Example:

function myExceptionHandler (Exception $ex) { return true; }
throw new Exception("This should cause a fatal error and this message will be lost");
echo "Test";

'Test' is never printed.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.