(PHP 5, PHP 7, PHP 8)
はじめに
Exception は、 すべてのユーザー例外の基底クラスです。
クラス概要
Exception implements Throwable {
protected
string
$message
protected
int
$code
protected
string
$file
protected
int
$line
/* メソッド */
public __construct
([ string $message
= ""
[, int $code
= 0
[, Throwable $previous
= null
]]] )
final public getMessage ( ) : string
final public getPrevious ( ) : Exception
final public getFile ( ) : string
final public getLine ( ) : int
final public getTrace ( ) : array
final public getTraceAsString ( ) : string
public __toString ( ) : string
final private __clone ( ) : void
}
プロパティ
message
- 例外メッセージ
code
- 例外コード
file
- 例外が作られたファイル名
line
- 例外が作られた行
目次
- Exception::__construct — 例外を作成する
- Exception::getMessage — 例外メッセージを取得する
- Exception::getPrevious — 前の例外を返す
- Exception::getCode — 例外コードを取得する
- Exception::getFile — 例外が作られたファイルを取得する
- Exception::getLine — 例外が作られた行を取得する
- Exception::getTrace — スタックトレースを取得する
- Exception::getTraceAsString — スタックトレースを文字列で取得する
- Exception::__toString — 例外の文字列表現
- Exception::__clone — 例外をコピーする
/* プロパティ */