rfc:throwable

This is an old revision of the document!


PHP RFC: Introduce Throwable interface and Error class

Introduction

PHP 7 replaces existing fatal or recoverable fatal errors with exceptions. While the respective RFC was already in voting, I proposed a change to the exception hierarchy it used (see below).

Proposal

This RFC proposes the following changes to PHP 7's exception hierarchy:

* Introduce a

Throwable

interface * Let

Exception

implement the

Throwable

interface * Introduce an

Error

class that implements the

Throwable

interface * Use

Error

class as base class for exceptions raised by the engine

Backward Incompatible Changes

Error

and

Throwable

are no longer available as names in the global namespace.

Proposed PHP Version(s)

PHP 7

References

rfc/throwable.1426404259.txt.gz · Last modified: 2017/09/22 13:28 (external edit)