title: PHP header not working in foreach
body: <p>Somewhat strange situation here</p>
  
  <pre><code>$location = 'Location: http://localhost/pages';
  //header($location); exit; works
  $response-&gt;header($location)-&gt;send(); exit; //doesn't work
  </code></pre>
  
  <p>and the <code>$response</code> object's class</p>
  
  <pre><code>public headers = [];
  
  public function header($string, $replace = true, $code = 200)
  {
      $this-&gt;headers[] = [
          'string' =&gt; $string,
          'replace' =&gt; $replace,
          'code' =&gt; $code
      ];
  
      return $this;
  }
  
  public function send()
  {
      foreach ($this-&gt;headers as $header) {
          header($header['string'], $header['replace'], $header['code']);
      }
  }
  </code></pre>
  
  <p>The code works fine when using vanilla <code>header</code> but it doesn't when using the methods. Am I missing something here?</p>