Exception

(PHP 5, PHP 7, PHP 8)

はじめに

Exception は、 すべてのユーザー例外の基底クラスです。

クラス概要

classExceptionimplementsThrowable {
protectedstring$message = "";
privatestring$string = "";
protectedint$code;
protectedstring$file = "";
protectedint$line;
privatearray$trace = [];
private?Throwable$previous = null;
public__construct(string$message = "", int$code = 0, ?Throwable$previous = null)
finalpublicgetMessage(): string
finalpublicgetPrevious(): ?Throwable
finalpublicgetCode(): int
finalpublicgetFile(): string
finalpublicgetLine(): int
finalpublicgetTrace(): array
finalpublicgetTraceAsString(): string
private__clone(): void
}

プロパティ

message

例外メッセージ

code

例外コード

file

例外が作られたファイル名

line

例外が作られた行

previous

直前にスローされた例外

string

スタックトレースを示す文字列

trace

スタックトレースを示す配列

目次

To Top