xref: /php-src/sapi/cli/tests/gh13113.phpt (revision c149b4f5)
1--TEST--
2GH-13113: Missing syntax error in CLI-server router script
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start('foo bar');
11
12$host = PHP_CLI_SERVER_HOSTNAME;
13$fp = php_cli_server_connect();
14$request = <<<REQUEST
15GET / HTTP/1.1
16Host: $host
17
18
19REQUEST;
20
21if(fwrite($fp, $request)) {
22    while (!feof($fp)) {
23        echo fgets($fp);
24    }
25}
26
27fclose($fp);
28?>
29--EXPECTF--
30HTTP/1.1 200 OK
31Host: %s
32Date: %s
33Connection: close
34X-Powered-By: PHP/%s
35Content-type: text/html; charset=UTF-8
36
37<br />
38<b>Parse error</b>:  syntax error, unexpected identifier &quot;bar&quot; in <b>%sindex.php</b> on line <b>1</b><br />
39