original_string: public function setHeader($header) {
          if (is_array($header)) {
              foreach ($header as $v) {
                  $this->setHeader($v);
              }
          } else {
              // Remove newlines, they are not allowed in headers.
              $newvalue = preg_replace('/[\r\n]/', '', $header);
              if (!in_array($newvalue, $this->header)) {
                  $this->header[] = $newvalue;
              }
          }
      }
code: public function setHeader($header) {
          if (is_array($header)) {
              foreach ($header as $v) {
                  $this->setHeader($v);
              }
          } else {
              // Remove newlines, they are not allowed in headers.
              $newvalue = preg_replace('/[\r\n]/', '', $header);
              if (!in_array($newvalue, $this->header)) {
                  $this->header[] = $newvalue;
              }
          }
      }
code_tokens: public function setHeader ( $ header ) { if ( is_array ( $ header ) ) { foreach ( $ header as $ v ) { $ this -> setHeader ( $ v ) ; } } else { // Remove newlines, they are not allowed in headers. $ newvalue = preg_replace ( '/[\r\n]/' , '' , $ header ) ; if ( ! in_array ( $ newvalue , $ this -> header ) ) { $ this -> header [ ] = $ newvalue ; } } }
docstring: Set HTTP Request Header
  
  @param array $header
docstring_tokens: Set HTTP Request Header