xref: /PHP-8.4/ext/standard/tests/http/bug75535.phpt (revision 47a199c8)
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(http_get_last_response_headers());
18
19var_dump(file_get_contents($uri));
20var_dump($http_response_header);
21var_dump(http_get_last_response_headers());
22
23http_server_kill($pid);
24
25?>
26--EXPECT--
27NULL
28string(0) ""
29array(2) {
30  [0]=>
31  string(15) "HTTP/1.0 200 Ok"
32  [1]=>
33  string(14) "Content-Length"
34}
35array(2) {
36  [0]=>
37  string(15) "HTTP/1.0 200 Ok"
38  [1]=>
39  string(14) "Content-Length"
40}
41