1--TEST--
2Implement Req #60850 (Built in web server does not set $_SERVER['SCRIPT_FILENAME'] when using router)
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start(<<<'PHP'
11var_dump($_SERVER['SCRIPT_FILENAME']);
12PHP
13);
14
15$host = PHP_CLI_SERVER_HOSTNAME;
16$fp = php_cli_server_connect();
17
18if(fwrite($fp, <<<HEADER
19POST / HTTP/1.1
20Host: {$host}
21
22
23HEADER
24)) {
25    while (!feof($fp)) {
26        echo fgets($fp);
27    }
28}
29
30fclose($fp);
31?>
32--EXPECTF--
33HTTP/1.1 200 OK
34Host: %s
35Date: %s
36Connection: close
37X-Powered-By: %s
38Content-type: text/html; charset=UTF-8
39
40string(%d) "%sindex.php"
41