Introducción
PHP Manual
PHP Manual»Interfaces y clases predefinidas»Throwable

Throwable

(PHP 7, PHP 8)

Throwable es la interfaz base para cualquier objeto que pueda ser lanzado mediante una sentencia throw, incluyendo Error y Exception.

Nota:

Las clases de PHP no pueden implementar la interfaz Throwable directamente, por lo que deben extender en su lugar Exception.

interface Throwable extends Stringable {
/* Métodos */
public function getMessage(): string
public function getCode(): int
public function getFile(): string
public function getLine(): int
public function getTrace(): array
public function getTraceAsString(): string
public function getPrevious(): ?Throwable
public function __toString(): string
/* Métodos heredados */
public function Stringable::__toString(): string
}
Versión Descripción
8.0.0 Throwable implementa Stringable ahora.

Tabla de contenidos

To Top