(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

class Throwable extends Stringable {
/* Methods */
public getMessage(): string
public getCode(): int
public getFile(): string
public getLine(): int
public getTrace(): array
public getTraceAsString(): string
public __toString(): string
/* Inherited methods */
public Stringable::__toString(): string


Version Description
8.0.0 Throwable implements Stringable now.

Table of Contents