Throwable::getCode
PHP function
Edit on GitHub ✎
(PHP 7, PHP 8)
Gets the exception code
Description
Throwable::getCode(): int
Returns the error code associated with the thrown object.
Parameters Parameters
Return Values
Returns the exception code as int in Exception but possibly as other type in Exception descendants (for example as string in PDOException).
See Also
Exception::getCode