« Throwable::getMessage
Throwable::getFile »

Throwable::getCode

(PHP 7, PHP 8)

Throwable::getCode — 例外コードを取得する

説明

public function Throwable::getCode(): int

スローされたオブジェクトのエラーコードを返します。

パラメータ

この関数にはパラメータはありません。

戻り値

例外コードを返します。 Exception の場合は int ですが、 その派生クラスでは別の型かもしれません (たとえば PDOException の場合は string です)。

参考

関連キーワード:
Throwable   コード   getCode   Exception   getMessage   getFile   エラーコード   派生   PDOException   参考
関連する関数・ページ:
throwable.getfile   exception.getcode   throwable.getprevious   class.throwable   error.getcode   throwable.getmessage