« 定義済みの例外
Exception::__construct »

Exception

(PHP 5, PHP 7, PHP 8)

はじめに

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

クラス概要

class Exception implements Throwable {
/* プロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private ?Throwable $previous = null;
/* メソッド */
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
}

プロパティ

message

例外メッセージ

code

例外コード

file

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

line

例外が作られた行

previous

直前にスローされた例外

string

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

trace

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

目次

関連キーワード:
Exception   final   Throwable   protected   private   スタック   トレース   construct   message   code   previous   プロパティ   line   trace   getMessage   getPrevious   getCode   getFile   getLine   getTrace   getTraceAsString   toString   clone   メッセージ   コード
関連する関数・ページ:
class.error   class.yaf-exception   class.runtimeexception   class.ui-exception-invalidargumentexception   class.imagickexception   class.com-exception