1--TEST-- 2Test curl_getinfo() function with CURLINFO_HTTP_VERSION parameter 3--SKIPIF-- 4<?php if (!extension_loaded("curl")) print "skip"; 5$curl_version = curl_version(); 6if ($curl_version['version_number'] < 0x073200) { 7 exit("skip: test works only with curl >= 7.50.0"); 8} 9?> 10--FILE-- 11<?php 12 13include 'server.inc'; 14 15$ch = curl_init(); 16var_dump(0 === curl_getinfo($ch, CURLINFO_HTTP_VERSION)); 17 18$host = curl_cli_server_start(); 19 20$url = "{$host}/get.inc?test="; 21curl_setopt($ch, CURLOPT_URL, $url); 22curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 23curl_exec($ch); 24var_dump(CURL_HTTP_VERSION_1_1 === curl_getinfo($ch, CURLINFO_HTTP_VERSION)); 25curl_close($ch); 26?> 27===DONE=== 28--EXPECT-- 29bool(true) 30bool(true) 31===DONE=== 32