Summary
Throughout this chapter, we took a detailed look through the PHP error handling mechanism. PHP 7 made quite a cleanup of its error handling model by wrapping most of it under the Throwable interface. This makes it possible to catch core errors via try...catch blocks that were, prior to PHP 7, reserved for Exception only. This leaves a bit of a terminology fuzz to digest now, as we come across Throwable, Error, Exception, system-errors, user-errors, notices, warnings and alike. Speaking high level, we might say that any faulty state is error. More specifically, we now have throwables on one side and errors on the other. Throwables encompass thrown and catchable instances of Error and Exception, whereas, errors encompass basically anything ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access