Created
April 15, 2019 14:09
-
-
Save MarioBlazek/2584c271f77354f7211f91b4d255527f to your computer and use it in GitHub Desktop.
PHP caught fatal error
This file contains hidden or 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 try { | |
// this will generate notice that would not be caught | |
echo $someNotSetVariable; | |
// fatal error that now actually is caught | |
someNoneExistentFunction(); | |
} catch (Error $e) { | |
echo "Error caught: " . $e->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment