/** * This method sends the message. * * @access public */ public function send() { header(implode(' ', array($this->protocol, $this->status, static::$statuses[$this->status]))); foreach ($this->headers as $name => $value) { header($name . ': ' . trim($value)); } header('content-length: ' . $this->getLength()); if ($this->body !== null) { echo $this->body->getBytes(); } exit; }