php8.5
Home/ Manual/ language / predefined/ Throwable

Throwable

Throwable is the base interface for any object that can be thrown via a Throw statement, including Error and Exception.

Intro

Throwable is the base interface for any object that can be thrown via a Throw statement, including Error and Exception.

Note

PHP classes cannot implement the Throwable interface directly, and must instead extend Exception.

Interfacesynopsis

implements Throwable extends Stringable { }

Changelog

VersionDescription
8.0.0Throwable implements Stringable now.

Getmessage Getcode Getfile Getline Gettrace Gettraceasstring Getprevious Tostring

In this section

Source: language/predefined/throwable.xml · from the official PHP manual (php/doc-en)