Introduction
PHP Manual
PHP Manual»Interfaces et Classes Prédéfinies»Throwable

Throwable

(PHP 7, PHP 8)

Throwable est l'interface de base pour tout objet qui peut être lancé grâce à la déclaration throw, ceci inclut Error et Exception.

Note:

Les classes PHP ne peuvent pas directement implémenter l'interface Throwable, et doivent à la place étendre Exception.

interface Throwable extends Stringable {
/* Méthodes */
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éthodes héritées */
public function Stringable::__toString(): string
}
Version Description
8.0.0 Throwable implémente désormais Stringable.

Sommaire

To Top