Errors are a normal part of the development and life cycle of an application. As such, PHP provides multiple ways to report and deal with errors.
PHP has two main mechanisms for reporting errors:
Throwable errors, which are further split into
programming errors via the Error
class hierarchy and recoverable errors via the
Exception class hierarchy. These errors
can be thrown with the throw keyword and caught with the catch keyword.
Diagnostic errors, which are classified into different severities.