getcode
Error::getCode
Gets the error code
ENTITY
final
public
int
Error::getCode
Returns the error code.
ENTITY ENTITY
ENTITY
Returns the error code as int
ENTITY
Error::getCode example
<?php
try {
throw new Error("Some error message", 30);
} catch(Error $e) {
echo "The Error code is: " . $e->getCode();
}
?>
ENTITY
The Error code is: 30
ENTITY
Throwable::getCode
这篇文档对你有帮助吗?
谢谢你的反馈!