Error

(PHP 7, PHP 8)

はじめに

Error は、PHP のすべての内部エラーの基底クラスです。

クラス概要

classErrorimplementsThrowable {
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