1--TEST-- 2$http_reponse_header (redirect) 3--SKIPIF-- 4<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:22347'); ?> 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:22347/try-again\r\n\r\n", 15 "data://test/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\n\r\nBody", 16); 17 18$pid = http_server("tcp://127.0.0.1:22347", $responses, $output); 19 20function test() { 21 $f = file_get_contents('http://127.0.0.1:22347/'); 22 var_dump($f); 23 var_dump($http_response_header); 24} 25test(); 26 27http_server_kill($pid); 28?> 29==DONE== 30--EXPECT-- 31string(4) "Body" 32array(5) { 33 [0]=> 34 string(18) "HTTP/1.0 302 Found" 35 [1]=> 36 string(12) "Some: Header" 37 [2]=> 38 string(42) "Location: http://127.0.0.1:22347/try-again" 39 [3]=> 40 string(15) "HTTP/1.0 200 Ok" 41 [4]=> 42 string(12) "Some: Header" 43} 44==DONE== 45