1--TEST--
2Implement Req #65917 (getallheaders() is not supported by the built-in web server)
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');
12var_dump(getallheaders());
13var_dump(apache_request_headers());
14var_dump(apache_response_headers());
15PHP
16);
17
18$host = PHP_CLI_SERVER_HOSTNAME;
19$fp = php_cli_server_connect();
20
21if(fwrite($fp, <<<HEADER
22GET / HTTP/1.1
23Host: {$host}
24Foo-Bar: Bar
25
26
27HEADER
28)) {
29    while (!feof($fp)) {
30        echo fgets($fp);
31    }
32}
33
34fclose($fp);
35?>
36--EXPECTF--
37HTTP/1.1 200 OK
38Host: %s
39Date: %s
40Connection: close
41X-Powered-By: %s
42Bar-Foo: Foo
43Content-type: text/html; charset=UTF-8
44
45array(2) {
46  ["Host"]=>
47  string(9) "localhost"
48  ["Foo-Bar"]=>
49  string(3) "Bar"
50}
51array(2) {
52  ["Host"]=>
53  string(9) "localhost"
54  ["Foo-Bar"]=>
55  string(3) "Bar"
56}
57array(3) {
58  ["X-Powered-By"]=>
59  string(%d) "P%s"
60  ["Bar-Foo"]=>
61  string(3) "Foo"
62  ["Content-type"]=>
63  string(24) "text/html; charset=UTF-8"
64}
65