original_string: private function _buildResponse($response)
      {
          $sections = explode("\r\n\r\n", $response, 2);
          $body = isset($sections[1]) ? $sections[1] : NULL;
          $headers = array();
          $headerlines = explode("\n", $sections[0]);
  
          // process status
          list($http, $code, $message) = explode(' ', $headerlines[0], 3);
  
          // process headers
          foreach (array_slice($headerlines, 1) as $headerline) {
              $headers[] = HeaderField::fromString($headerline);
          }
  
          $response = new Response($code, $headers, $body);
  
          return $response;
      }
code: private function _buildResponse($response)
      {
          $sections = explode("\r\n\r\n", $response, 2);
          $body = isset($sections[1]) ? $sections[1] : NULL;
          $headers = array();
          $headerlines = explode("\n", $sections[0]);
  
          // process status
          list($http, $code, $message) = explode(' ', $headerlines[0], 3);
  
          // process headers
          foreach (array_slice($headerlines, 1) as $headerline) {
              $headers[] = HeaderField::fromString($headerline);
          }
  
          $response = new Response($code, $headers, $body);
  
          return $response;
      }
code_tokens: private function _buildResponse ( $ response ) { $ sections = explode ( "\r\n\r\n" , $ response , 2 ) ; $ body = isset ( $ sections [ 1 ] ) ? $ sections [ 1 ] : NULL ; $ headers = array ( ) ; $ headerlines = explode ( "\n" , $ sections [ 0 ] ) ; // process status list ( $ http , $ code , $ message ) = explode ( ' ' , $ headerlines [ 0 ] , 3 ) ; // process headers foreach ( array_slice ( $ headerlines , 1 ) as $ headerline ) { $ headers [ ] = HeaderField :: fromString ( $ headerline ) ; } $ response = new Response ( $ code , $ headers , $ body ) ; return $ response ; }
docstring: Parses a response into headers and a body
docstring_tokens: Parses a response into headers and a body