1--TEST-- 2$http_reponse_header (redirect + not found) 3--SKIPIF-- 4<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:22348'); ?> 5--INI-- 6allow_url_fopen=1 7allow_url_include=1 8--FILE-- 9<?php 10require 'server.inc'; 11 12$responses = array( 13 "data://text/plain,HTTP/1.0 302 Found\r\n" 14 . "Some: Header\r\nLocation: http://127.0.0.1:22348/try-again\r\n\r\n", 15 "data://test/plain,HTTP/1.0 404 Not Found\r\nSome: Header\r\n\r\nBody", 16); 17 18$pid = http_server("tcp://127.0.0.1:22348", $responses, $output); 19 20function test() { 21 $f = file_get_contents('http://127.0.0.1:22348/'); 22 var_dump($f); 23 var_dump($http_response_header); 24} 25test(); 26 27http_server_kill($pid); 28?> 29==DONE== 30--EXPECTF-- 31Warning: file_get_contents(http://127.0.0.1:22348/): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%a 32bool(false) 33array(5) { 34 [0]=> 35 string(18) "HTTP/1.0 302 Found" 36 [1]=> 37 string(12) "Some: Header" 38 [2]=> 39 string(42) "Location: http://127.0.0.1:22348/try-again" 40 [3]=> 41 string(22) "HTTP/1.0 404 Not Found" 42 [4]=> 43 string(12) "Some: Header" 44} 45==DONE== 46