1--TEST--
2apache_response_headers()
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "include.inc";
10
11$php = get_cgi_path();
12reset_env_vars();
13
14$test_file = __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php";
15
16$code  = '<?php';
17$code .= '
18header( "X-Robots-Tag : noindex,nofollow,noarchive" );
19header( "Content-type: text/html; charset=UTF-8" );
20header( "Bad-header" );
21header( " : " );
22header( ":" );
23flush();
24
25var_dump( apache_response_headers() );
26?>
27';
28
29file_put_contents( $test_file, $code );
30
31passthru( "$php -n -q " . escapeshellarg( $test_file ) );
32
33?>
34--CLEAN--
35<?php
36@unlink( __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" );
37?>
38--EXPECTF--
39array(3) {
40  ["X-Powered-By"]=>
41  string(%d) "PHP/%s"
42  ["X-Robots-Tag"]=>
43  string(26) "noindex,nofollow,noarchive"
44  ["Content-type"]=>
45  string(24) "text/html; charset=UTF-8"
46}
47