This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_exception_handler(function ($e) { | |
echo 'Got it: ' . $e->getMessage() . "\n"; | |
}); | |
register_shutdown_function(function () { | |
throw new \Exception('This one will cause Fatal error'); | |
}); | |
throw new \Exception('Will be caught by exception handler'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got it: Will be caught by exception handler
PHP Fatal error: Uncaught Exception: This one will cause Fatal error in /home/josef/work/src/shutdown.php:8
Stack trace:
#0 [internal function]: {closure}()
#1 {main}
thrown in /home/josef/work/src/shutdown.php on line 8