phpday 2027 - Call for Papers

Throwable::getCode

(PHP 7, PHP 8)

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

説明

public function Throwable::getCode(): int

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

パラメータ

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

戻り値

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

参考

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top