(PHP 7, PHP 8)


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


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

Interface synopsis

interface Throwable {
/* Methods */
public getMessage(): string
public getCode(): int
public getFile(): string
public getLine(): int
public getTrace(): array
public getTraceAsString(): string
abstract public __toString(): string

Table of Contents