Throwable

(PHP 7, PHP 8)

Introduction

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.

Sommaire de l'Interface

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
}

Historique

Version Description
8.0.0 Throwable implémente désormais Stringable.

Sommaire