public function sendHeader($output = null, $replace = true, $http_response_code = null)
    {
        if (!headers_sent()) {
            if(static::$redirectHeader !== null) {
                $this->redirect();
            }
            if($this->version === 'HTTP/1.1') {
                if(count($this->headers) === 0) {
                    header("$this->version $this->header");
                }
            }
            else {
                throw new Exception("Invalid HTTP version ".$this->version.".");
                exit;
            }
            foreach($this->headers as $header) {
                if($http_response_code == null) {
                    header("$header", $replace);
                }
                else {
                    header("$header", $replace, $http_response_code);
                }
            }
            if($output) {
                print $output;
                exit;
            }
        } 
    }