Exception

(PHP 5, PHP 7, PHP 8)

Einführung

Exception ist die Basisklasse für alle Benutzer-Exceptions.

Klassenbeschreibung

class Exception implements Throwable {
/* Eigenschaften */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private ?Throwable $previous = null;
/* Methoden */
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
final public function getMessage(): string
final public function getPrevious(): ?Throwable
final public function getCode(): int
final public function getFile(): string
final public function getLine(): int
final public function getTrace(): array
final public function getTraceAsString(): string
public function __toString(): string
private function __clone(): void
}

Eigenschaften

message

Die Exceptionmeldung

code

Die Fehlernummer der Exception

file

Der Name der Datei, in der die Exception erzeugt wurde

line

Die Zeile, in der die Exception ausgelöst wurde

previous

Die zuvor ausgelöste Exception

string

Die String-Darstellung des Stacktraces

trace

Der Stacktrace als Array

Inhaltsverzeichnis