src/debug/ErrorHandler.php
public static function setupExceptionHandling() {
        $previous = set_exception_handler(self::$exceptionHandler=__CLASS__.'::handleException');

        /**
         * Detect entering of the script's shutdown phase to be capable of handling destructor exceptions during shutdown
         * differently and avoid otherwise fatal errors. Should be the very first function on the shutdown function stack.
         *
         * @see  http://php.net/manual/en/language.oop5.decon.php
         * @see  ErrorHandler::handleDestructorException()
         */
        register_shutdown_function(function() {
            self::$inShutdown = true;
        });
        return $previous;
    }
public static function setupExceptionHandling() {
        $previous = set_exception_handler(self::$exceptionHandler=__CLASS__.'::handleException');

        /**
         * Detect entering of the script's shutdown phase to be capable of handling destructor exceptions during shutdown
         * differently and avoid otherwise fatal errors. Should be the very first function on the shutdown function stack.
         *
         * @see  http://php.net/manual/en/language.oop5.decon.php
         * @see  ErrorHandler::handleDestructorException()
         */
        register_shutdown_function(function() {
            self::$inShutdown = true;
        });
        return $previous;
    }
public static function setupExceptionHandling ( ) { $ previous = set_exception_handler ( self :: $ exceptionHandler = __CLASS__ . '::handleException' ) ; /**
         * Detect entering of the script's shutdown phase to be capable of handling destructor exceptions during shutdown
         * differently and avoid otherwise fatal errors. Should be the very first function on the shutdown function stack.
         *
         * @see  http://php.net/manual/en/language.oop5.decon.php
         * @see  ErrorHandler::handleDestructorException()
         */ register_shutdown_function ( function ( ) { self :: $ inShutdown = true ; } ) ; return $ previous ; }
Setup global exception handling.

@return callable|null - Returns the name of the previously defined exception handler, or NULL if no previous handler
was defined or an error occurred.
Setup global exception handling .