src/ErrorStack.php
static function handleDone()
    {
        $return = null;

        if (!self::hasHandling())
            ## there is no error
            return $return;

        $stack = array_pop(self::$_STACK);
        if ($stack['has_handled_error'])
            $return = $stack['has_handled_error'];

        # restore error handler
        (($stack['error_type']) === self::ERR_TYP_ERROR)
            ? restore_error_handler()
            : restore_exception_handler()
        ;

        return $return;
    }
static function handleDone()
    {
        $return = null;

        if (!self::hasHandling())
            ## there is no error
            return $return;

        $stack = array_pop(self::$_STACK);
        if ($stack['has_handled_error'])
            $return = $stack['has_handled_error'];

        # restore error handler
        (($stack['error_type']) === self::ERR_TYP_ERROR)
            ? restore_error_handler()
            : restore_exception_handler()
        ;

        return $return;
    }
static function handleDone ( ) { $ return = null ; if ( ! self :: hasHandling ( ) ) ## there is no error return $ return ; $ stack = array_pop ( self :: $ _STACK ) ; if ( $ stack [ 'has_handled_error' ] ) $ return = $ stack [ 'has_handled_error' ] ; # restore error handler ( ( $ stack [ 'error_type' ] ) === self :: ERR_TYP_ERROR ) ? restore_error_handler ( ) : restore_exception_handler ( ) ; return $ return ; }
Stopping The Error Handling Stack

!! It can using only for error not exceptions

@return null|ErrorException Last error if has
Stopping The Error Handling Stack