1--TEST-- 2$http_reponse_header (redirect + not found) 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 302 Found\r\n" 13 . "Some: Header\r\nLocation: /try-again\r\n\r\n", 14 "data://test/plain,HTTP/1.0 404 Not Found\r\nSome: Header\r\n\r\nBody", 15); 16 17['pid' => $pid, 'uri' => $uri] = http_server($responses, $output); 18 19$f = file_get_contents($uri); 20var_dump($f); 21var_dump($http_response_header); 22 23http_server_kill($pid); 24 25--EXPECTF-- 26Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%a 27bool(false) 28array(5) { 29 [0]=> 30 string(18) "HTTP/1.0 302 Found" 31 [1]=> 32 string(12) "Some: Header" 33 [2]=> 34 string(20) "Location: /try-again" 35 [3]=> 36 string(22) "HTTP/1.0 404 Not Found" 37 [4]=> 38 string(12) "Some: Header" 39} 40