original_string: private static function fixHttpHeaderField($header)
      {
          if (!is_array($header)) {
              $header = explode("\r\n", $header);
          }
          uasort($header, function ($el) {
              return preg_match('{^content-type}i', $el) ? 1 : -1;
          });
  
          return $header;
      }
code: private static function fixHttpHeaderField($header)
      {
          if (!is_array($header)) {
              $header = explode("\r\n", $header);
          }
          uasort($header, function ($el) {
              return preg_match('{^content-type}i', $el) ? 1 : -1;
          });
  
          return $header;
      }
code_tokens: private static function fixHttpHeaderField ( $ header ) { if ( ! is_array ( $ header ) ) { $ header = explode ( "\r\n" , $ header ) ; } uasort ( $ header , function ( $ el ) { return preg_match ( '{^content-type}i' , $ el ) ? 1 : - 1 ; } ) ; return $ header ; }
docstring: A bug in PHP prevents the headers from correctly being sent when a content-type header is present and
  NOT at the end of the array
  
  This method fixes the array by moving the content-type header to the end
  
  @link https://bugs.php.net/bug.php?id=61548
  @param $header
  @return array
docstring_tokens: A bug in PHP prevents the headers from correctly being sent when a content - type header is present and NOT at the end of the array