ErrorException::getSeverity

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

ErrorException::getSeverity — 예외 심각도를 가져옵니다.


설명

final public ErrorException::getSeverity(): int

예외의 심각도를 반환합니다.


매개변수

이 함수에는 매개변수가 없습니다.


반환 값

예외의 심각도 수준을 반환합니다.


Examples

예제 #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)