public function deregisterGlobalHandlers()
    {
        if ($this->registered) {
            // Restore the previous error handler if available
            set_error_handler(
                is_callable($this->errorHandler) ? $this->errorHandler : function () { }
            );
            // Restore the previous exception handler if available
            set_exception_handler(
                is_callable($this->exceptionHandler) ? $this->exceptionHandler : function () { }
            );
            $this->registered = false;
        }
    }