`Exception::uncaught` can receive a `BaseException` in PHP7.0
Hywan opened this issue · comments
Related to #80.
Quoting https://github.com/php/php-src/blob/7dcfdbbee431c93c52605e1df323d18e0c6088e9/UPGRADING#L323-L351:
Changes to error handling
The new base class of the exception hierarchy is BaseException, from which
Exception extends. Typehints in exception handling code may need to be changed
to account for this.Some fatal errors and recoverable fatal errors now throw an EngineException
instead. As EngineException extends BaseException but not Exception, these
exceptions will not caught by existing try/catch blocks.For the recoverable fatal errors which have been converted into an exception,
it is no longer possible to silently ignore the error from an error handler.
In particular, it is no longer possible to ignore typehint failures.Parser errors now generate a ParseException (extends BaseException). Error
handling for eval()s on potentially invalid code should be changed to catch
ParseException in addition to the previous return value / error_get_last()
based handling.Constructors of internal classes will now always throw an exception on
failure. Previously some constructors returned NULL or an unusable object.The error level of some E_STRICT notices has been changed.
Relevant RFCs: