Back to ExceptionHandler class

Method isException

protected static bool
isException
(mixed $error)
Checks if given error belong to PHP exception class (\Throwable for PHP 7+, \Exception for PHP 5-).
Parameters
  • mixed $error Any error value.
Returns
  • bool
Since
  • 3.10.0

Method isException - Source code

/**
 * Checks if given error belong to PHP exception class (\Throwable for PHP 7+, \Exception for PHP 5-).
 *
 * @param   mixed  $error  Any error value.
 *
 * @return  boolean
 *
 * @since   3.10.0
 */
protected static function isException($error)
{
    return $error instanceof \Throwable;
}