original_string: public function getHeader($header, $first = true)
      {
          $normalizedHeader = str_replace('-', '_', strtolower($header));
          foreach ($this->headers as $key => $value) {
              if (str_replace('-', '_', strtolower($key)) === $normalizedHeader) {
                  if ($first) {
                      return is_array($value) ? (count($value) ? $value[0] : '') : $value;
                  }
  
                  return is_array($value) ? $value : array($value);
              }
          }
  
          return $first ? null : array();
      }
code: public function getHeader($header, $first = true)
      {
          $normalizedHeader = str_replace('-', '_', strtolower($header));
          foreach ($this->headers as $key => $value) {
              if (str_replace('-', '_', strtolower($key)) === $normalizedHeader) {
                  if ($first) {
                      return is_array($value) ? (count($value) ? $value[0] : '') : $value;
                  }
  
                  return is_array($value) ? $value : array($value);
              }
          }
  
          return $first ? null : array();
      }
code_tokens: public function getHeader ( $ header , $ first = true ) { $ normalizedHeader = str_replace ( '-' , '_' , strtolower ( $ header ) ) ; foreach ( $ this -> headers as $ key => $ value ) { if ( str_replace ( '-' , '_' , strtolower ( $ key ) ) === $ normalizedHeader ) { if ( $ first ) { return is_array ( $ value ) ? ( count ( $ value ) ? $ value [ 0 ] : '' ) : $ value ; } return is_array ( $ value ) ? $ value : array ( $ value ) ; } } return $ first ? null : array ( ) ; }
docstring: Gets a response header.
  
  @param string $header The header name
  @param bool   $first  Whether to return the first value or all header values
  
  @return string|array The first header value if $first is true, an array of values otherwise
docstring_tokens: Gets a response header .