8. Fatal Errors
● Fatal errors cannot be gracefully handled
● Error handler is not called
● Finally block will not be invoked
● Destructors are not called
11. Error & Exception handling
Errors and fatal errors handling
try {
inexistant_function();
} catch (Error $e) {
echo 'Error: '.$e->getMessage();
}
// PHP5:
// Fatal error: Call to undefined function
// inexistant_function() in …
// PHP7:
// Error: Call to undefined function inexistant_function()
12. Bibliography
RFC for EngineException: https://wiki.php.net/rfc/engine_exceptions_for_php7
Reviewed RFC about Throwable: https://wiki.php.net/rfc/throwable-interface
Article about PHP7 Throwable and Errors: https://trowski.com/2015/06/24/throwable-exceptions-and-errors-
in-php7/
Stackoverflow, Errors VS Exception:http://stackoverflow.com/questions/…