1--TEST-- 2Bug #55747 (request headers missed in $_SERVER) 3--INI-- 4allow_url_fopen=1 5--SKIPIF-- 6<?php 7include "skipif.inc"; 8?> 9--FILE-- 10<?php 11include "php_cli_server.inc"; 12php_cli_server_start('foreach($_SERVER as $k=>$v) { if (!strncmp($k, "HTTP", 4)) var_dump( $k . ":" . $v); }'); 13 14$host = PHP_CLI_SERVER_HOSTNAME; 15$fp = php_cli_server_connect(); 16 17if(fwrite($fp, <<<HEADER 18GET / HTTP/1.1 19Host:{$host} 20User-Agent:dummy 21Custom:foo 22Referer:http://www.php.net/ 23 24 25HEADER 26)) { 27 while (!feof($fp)) { 28 echo fgets($fp); 29 } 30} 31 32?> 33--EXPECTF-- 34HTTP/1.1 200 OK 35Host: %s 36Date: %s 37Connection: close 38X-Powered-By: PHP/%s 39Content-type: text/html; charset=UTF-8 40 41string(19) "HTTP_HOST:localhost" 42string(21) "HTTP_USER_AGENT:dummy" 43string(15) "HTTP_CUSTOM:foo" 44string(32) "HTTP_REFERER:http://www.php.net/" 45