(PHP 7, PHP 8)
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.
public getMessage(): string
public getCode(): int
public getFile(): string
public getLine(): int
public getTrace(): array
public getTraceAsString(): string
public getPrevious(): ?Throwable
public __toString(): string
public Stringable::__toString(): string}
| Version | Description |
|---|---|
| 8.0.0 | Throwable implements Stringable now. |
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.throwable.php