whoopsShutdownHandler = $function; register_shutdown_function([$this, 'handleShutdown']); } /** * Special case to deal with Fatal errors and the like. */ public function handleShutdown() { $error = $this->getLastError(); // Ignore core warnings and errors. if ($error && !($error['type'] & (E_CORE_WARNING | E_CORE_ERROR))) { $handler = $this->whoopsShutdownHandler; $handler(); } } }