1--TEST-- 2SERVER_PROTOCOL header availability 3--SKIPIF-- 4<?php 5include "skipif.inc"; 6?> 7--FILE-- 8<?php 9include "php_cli_server.inc"; 10php_cli_server_start('var_dump($_SERVER["SERVER_PROTOCOL"]);'); 11 12$host = PHP_CLI_SERVER_HOSTNAME; 13$fp = php_cli_server_connect(); 14 15if(fwrite($fp, <<<HEADER 16GET / HTTP/1.1 17Host: {$host} 18 19 20HEADER 21)) { 22 while (!feof($fp)) { 23 echo fgets($fp); 24 } 25} 26 27fclose($fp); 28 29$fp = php_cli_server_connect(); 30 31if(fwrite($fp, <<<HEADER 32GET / HTTP/1.0 33Host: {$host} 34 35 36HEADER 37)) { 38 while (!feof($fp)) { 39 echo fgets($fp); 40 } 41} 42 43fclose($fp); 44?> 45--EXPECTF-- 46HTTP/1.1 200 OK 47Host: %s 48Date: %s 49Connection: close 50X-Powered-By: PHP/%s 51Content-type: text/html; charset=UTF-8 52 53string(8) "HTTP/1.1" 54HTTP/1.0 200 OK 55Host: %s 56Date: %s 57Connection: close 58X-Powered-By: PHP/%s 59Content-type: text/html; charset=UTF-8 60 61string(8) "HTTP/1.0" 62