xref: /PHP-8.2/ext/standard/tests/http/bug75535.phpt (revision 95f25837)
1--TEST--
2Bug #75535: Inappropriately parsing HTTP response leads to PHP segment fault
3--SKIPIF--
4<?php require 'server.inc'; http_server_skipif(); ?>
5--INI--
6allow_url_fopen=1
7--FILE--
8<?php
9require 'server.inc';
10
11$responses = array(
12    "data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n",
13);
14
15['pid' => $pid, 'uri' => $uri] = http_server($responses, $output);
16
17var_dump(file_get_contents($uri));
18var_dump($http_response_header);
19
20http_server_kill($pid);
21
22--EXPECT--
23string(0) ""
24array(2) {
25  [0]=>
26  string(15) "HTTP/1.0 200 Ok"
27  [1]=>
28  string(14) "Content-Length"
29}
30