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/bug71005.phpt ('Bug #71005 (Segfault in php_cli_server_dispatch_router())')

Script

1: <?php
2:
3: $code 
= <<<'EOF'
4:
set_exception_handler(function () { echo 'goodbye'; });
5: throw new Exception;
6:
EOF;
7:
8: include 
"php_cli_server.inc";
9:
php_cli_server_start($code);
10:
11: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
12:
$port intval($port) ?: 80;
13:
14:
$fp fsockopen($host$port$errno$errstr0.5);
15: if (!
$fp) {
16:   die(
"connect failed");
17: }
18:
19: if(
fwrite($fp, <<<HEADER
20:
GET / HTTP/1.1
21: Host: 
{$host}
22:
23:
24:
HEADER
25: )) {
26:     while (!
feof($fp)) {
27:         echo 
fgets($fp);
28:     }
29: }
30:
31:
?>
32:

Expected

HTTP/1.1 200 OK
Host: %s
Date: %s
Connection: close
X-Powered-By: PHP/%s
Content-type: text/html; charset=UTF-8

goodbye

Output

Unable to connect to server

Diff

001+ Unable to connect to server
001- HTTP/1.1 200 OK
002- Host: %s
003- Date: %s
004- Connection: close
005- X-Powered-By: PHP/%s
006- Content-type: text/html; charset=UTF-8
007- 
008- goodbye

 

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

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