1--TEST--
2Bug #60591 (Memory leak when access a non-exists file)
3--DESCRIPTION--
4this is an indirect test for bug 60591, since mem leak is reproted in the server side
5and require php compiled with --enable-debug
6--SKIPIF--
7<?php
8include "skipif.inc";
9?>
10--FILE--
11<?php
12include "php_cli_server.inc";
13php_cli_server_start(<<<'PHP'
14if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
15        return false; // serve the requested resource as-is.
16else {
17        echo "here";
18}
19PHP
20);
21
22$host = PHP_CLI_SERVER_HOSTNAME;
23$fp = php_cli_server_connect();
24
25if(fwrite($fp, <<<HEADER
26POST /no-exists.jpg HTTP/1.1
27Host: {$host}
28
29
30HEADER
31)) {
32	while (!feof($fp)) {
33		echo fgets($fp);
34        break;
35	}
36}
37
38fclose($fp);
39?>
40--EXPECT--
41HTTP/1.1 404 Not Found
42