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 = dirname(__FILE__) . 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===DONE===
35--CLEAN--
36<?php
37@unlink( dirname(__FILE__) . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" );
38?>
39--EXPECTF--
40array(3) {
41  ["X-Powered-By"]=>
42  string(%d) "PHP/%s"
43  ["X-Robots-Tag"]=>
44  string(26) "noindex,nofollow,noarchive"
45  ["Content-type"]=>
46  string(24) "text/html; charset=UTF-8"
47}
48===DONE===
49