protected function _getHttpStatusFromHeaders($headers)
  {
    $httpstatus = '500';
    $match      = [];
    if (!empty($headers[0]) && preg_match('/HTTP\/\d\.\d (\d{3})/', $headers[0], $match)) {
      $httpstatus = $match[1];
    }
    return $httpstatus;
  }
protected function _getHttpStatusFromHeaders($headers)
  {
    $httpstatus = '500';
    $match      = [];
    if (!empty($headers[0]) && preg_match('/HTTP\/\d\.\d (\d{3})/', $headers[0], $match)) {
      $httpstatus = $match[1];
    }
    return $httpstatus;
  }
protected function _getHttpStatusFromHeaders ( $ headers ) { $ httpstatus = '500' ; $ match = [ ] ; if ( ! empty ( $ headers [ 0 ] ) && preg_match ( '/HTTP\/\d\.\d (\d{3})/' , $ headers [ 0 ] , $ match ) ) { $ httpstatus = $ match [ 1 ] ; } return $ httpstatus ; }
Extract HTTP status code from headers

@param array $headers The headers to parse

@return string The HTTP status code
Extract HTTP status code from headers