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

Test Failure Report for sapi/cli/tests/php_cli_server_016.phpt ('Bug #60591 (Memory leak when access a non-exists file)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(<<<'PHP'
4:
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
5:         return false; // serve the requested resource as-is.
6: else {
7:         echo "here";
8: }
9:
PHP
10: );
11:
12: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
13:
$port intval($port)?:80;
14:
15:
$fp fsockopen($host$port$errno$errstr0.5);
16: if (!
$fp) {
17:   die(
"connect failed");
18: }
19:
20: if(
fwrite($fp, <<<HEADER
21:
POST /no-exists.jpg HTTP/1.1
22: Host: 
{$host}
23:
24:
25:
HEADER
26: )) {
27:     while (!
feof($fp)) {
28:         echo 
fgets($fp);
29:         break;
30:     }
31: }
32:
33:
fclose($fp);
34:
?>
35:

Expected

HTTP/1.1 404 Not Found

Output

Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_5/sapi/cli/tests/php_cli_server_016.php on line 15
connect failed

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_5/sapi/cli/tests/php_cli_server_016.php on line 15
001- HTTP/1.1 404 Not Found
002+ connect failed

 

Generated at Thu, 31 Jul 2014 10:10:51 +0000 (27 hours ago)

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