1--TEST-- 2Check PHP file body is executed 3--SKIPIF-- 4<?php 5include "skipif.inc"; 6?> 7--FILE-- 8<?php 9include "php_cli_server.inc"; 10php_cli_server_start(<<<'PHP' 11header('Bar-Foo: Foo'); 12echo "Hello world\n"; 13var_dump(true); 14PHP 15); 16 17$host = PHP_CLI_SERVER_HOSTNAME; 18$fp = php_cli_server_connect(); 19 20if(fwrite($fp, <<<HEADER 21GET / HTTP/1.1 22Host: {$host} 23Foo-Bar: Bar 24 25 26HEADER 27)) { 28 while (!feof($fp)) { 29 echo fgets($fp); 30 } 31} 32 33fclose($fp); 34?> 35--EXPECTF-- 36HTTP/1.1 200 OK 37Host: %s 38Date: %s 39Connection: close 40X-Powered-By: %s 41Bar-Foo: Foo 42Content-type: text/html; charset=UTF-8 43 44Hello world 45bool(true) 46