WordPress at Your Fingertips
function is not described

SimplePie_HTTP_Parser::http_version() protected WP 1.0

Parse the HTTP version

{} It's a method of the class: SimplePie_HTTP_Parser{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->http_version();

Code of SimplePie_HTTP_Parser::http_version() WP 5.8.2

protected function http_version()
{
	if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/')
	{
		$len = strspn($this->data, '0123456789.', 5);
		$this->http_version = substr($this->data, 5, $len);
		$this->position += 5 + $len;
		if (substr_count($this->http_version, '.') <= 1)
		{
			$this->http_version = (float) $this->http_version;
			$this->position += strspn($this->data, "\x09\x20", $this->position);
			$this->state = 'status';
		}
		else
		{
			$this->state = false;
		}
	}
	else
	{
		$this->state = false;
	}
}