ErrorException::getSeverity

(PHP 5 >= 5.1.0, PHP 7)
Gets the exception severity
final public int ErrorException::getSeverity ( void )

Returns the severity of the exception.

Returns:

Returns the severity level of the exception.

Examples:
ErrorException::getSeverity() example
1
2
3
4
5
6
7
<?php
try {
    throw new ErrorException("Exception message", 0, 75);
catch(ErrorException $e) {
    echo "This exception severity is: " $e->getSeverity();
}
?>

The above example will output something similar to:

This exception severity is: 75
doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.