Errorexception/getseverity-Phpdoc专题

ErrorException::getSeverity

获取异常的严重程度

说明

final public int <span class="methodname">ErrorException::getSeverity ( <span class="methodparam">void )

返回异常的严重程度。

参数

此函数没有参数。

返回值

返回异常的严重级别。

范例

示例 #1 ErrorException::getSeverity 例子

<?php
try {
    throw new ErrorException("Exception message", 0, E_USER_ERROR);
} catch(ErrorException $e) {
    echo "This exception severity is: " . $e->getSeverity();
    var_dump($e->getSeverity() === E_USER_ERROR);
}
?>

以上例程的输出类似于:

This exception severity is: 256
bool(true)

本站为非盈利网站,作品由网友提供上传,如无意中有侵犯您的版权,请联系删除