PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for sapi/cli/tests/emptyheader.phpt ('Correctly handle split and empty header')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start("var_dump(getAllheaders());");
4:
5:
$fp fsockopen(PHP_CLI_SERVER_HOSTNAMEPHP_CLI_SERVER_PORT$errno$errmsg0.5);
6:
7: if (!
$fp) {
8:     die(
"connect failed: " $errmsg);
9: }
10:
11:
fwrite($fp"GET / HTTP/1.1\r\nUser-Agent\r\nAccept: */*\r\nReferer:\r\nHi\r\n\r\n");
12:
fflush($fp);
13: while (!
feof($fp)) {
14:     echo 
fgets($fp);
15: }
16:
fclose($fp);
17:
?>
18:

Expected

HTTP/1.1 200 OK
%a
array(3) {
  ["User-AgentAccept"]=>
  string(3) "*/*"
  ["Referer"]=>
  string(0) ""
  ["Hi"]=>
  string(0) ""
}

Output

Unable to connect to server

Diff

001- HTTP/1.1 200 OK
003- array(3) {
004-   ["User-AgentAccept"]=>
005-   string(3) "*/*"
006-   ["Referer"]=>
007-   string(0) ""
008-   ["Hi"]=>
009-   string(0) ""
010- }

 

Generated at Sun, 12 Nov 2017 21:17:35 +0000 (8 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.