Skip to content

Instantly share code, notes, and snippets.

@MarioBlazek
Created April 15, 2019 14:09
Show Gist options
  • Save MarioBlazek/2584c271f77354f7211f91b4d255527f to your computer and use it in GitHub Desktop.
Save MarioBlazek/2584c271f77354f7211f91b4d255527f to your computer and use it in GitHub Desktop.
PHP caught fatal error
<?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