src/debug/ErrorHandler.php
public static function handleDestructorException(\Exception $exception) {
        if (self::isInShutdown()) {
            self::handleException($exception);
            exit(1);                                                // exit and signal the error

            // Calling exit() is the only way to prevent the immediately following non-catchable fatal error.
            // However, calling exit() in a destructor will also prevent any remaining shutdown routines from executing.
            // @see above link
        }
        return $exception;
    }
public static function handleDestructorException(\Exception $exception) {
        if (self::isInShutdown()) {
            self::handleException($exception);
            exit(1);                                                // exit and signal the error

            // Calling exit() is the only way to prevent the immediately following non-catchable fatal error.
            // However, calling exit() in a destructor will also prevent any remaining shutdown routines from executing.
            // @see above link
        }
        return $exception;
    }
public static function handleDestructorException ( \ Exception $ exception ) { if ( self :: isInShutdown ( ) ) { self :: handleException ( $ exception ) ; exit ( 1 ) ; // exit and signal the error // Calling exit() is the only way to prevent the immediately following non-catchable fatal error. // However, calling exit() in a destructor will also prevent any remaining shutdown routines from executing. // @see above link } return $ exception ; }
Manually called handler for exceptions occurring in object destructors.

Attempting to throw an exception from a destructor during script shutdown causes a fatal error. Therefore this method
has to be called manually from object destructors if an exception occurred. If the script is in the shutdown phase
the exception is passed on to the regular exception handler and the script is terminated. If the script is currently
not in the shutdown phase this method ignores the exception. For an example see this package's README.

@param  \Exception $exception

@return \Exception - the same exception

@link   http://php.net/manual/en/language.oop5.decon.php
Manually called handler for exceptions occurring in object destructors .