array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'errorexception.getseverity.php', 1 => 'ErrorException::getSeverity', 2 => 'Gets the exception severity', ), 'up' => array ( 0 => 'class.errorexception.php', 1 => 'ErrorException', ), 'prev' => array ( 0 => 'errorexception.construct.php', 1 => 'ErrorException::__construct', ), 'next' => array ( 0 => 'class.closedgeneratorexception.php', 1 => 'ClosedGeneratorException', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'language/predefined/errorexception/getseverity.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ErrorException::getSeverity

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

ErrorException::getSeverityGets the exception severity

Опис

final public ErrorException::getSeverity(): int

Returns the severity of the exception.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns the severity level of the exception.

Приклади

Приклад #1 ErrorException::getSeverity() example

<?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)