PHP 7 Changes the way most errors are reported. Unlike traditional (PHP 5) Error reporting mechanisms, most errors are now thrown as error exceptions.
This Error exception can be captured by the first matching Try/catch block like Exception exception. If there is no matching catch block, the exception handler function is invoked (in advance through Set_exception_handler () registration) for processing. If an exception handler has not been registered, it is handled in the traditional manner: reported as a fatal error (Fatal).
The error class is not inherited from the Exception class, so you cannot use catch (Exception $e) {...} to catch the error. You can catch the error by catching (Error $e) {...}, or by registering an exception handler (Set_exception_handler ()).
Error hierarchy
Throwable
|-error
|--arithmeticerror
--|--divisionbyzeroerror
|--assertionerror
|--parseerror
|--typeerror
|-exception
| ——...