1--TEST-- 2header() and friends 3--SKIPIF-- 4<?php 5if (php_sapi_name() != "cli") { 6 die("skip this test is for CLI"); 7} 8?> 9--FILE-- 10<?php 11 12$v1 = headers_sent(); 13$v2 = headers_list(); 14var_dump(header("HTTP 1.0", true, 200)); 15 16var_dump($v1); 17var_dump($v2); 18 19var_dump(header("")); 20var_dump(header("", true)); 21var_dump(headers_sent()); 22var_dump(headers_list()); 23var_dump(header("HTTP blah")); 24var_dump(header("HTTP blah", true)); 25var_dump(headers_sent()); 26var_dump(headers_list()); 27 28echo "Done\n"; 29?> 30--EXPECTF-- 31NULL 32bool(false) 33array(0) { 34} 35 36Warning: Cannot modify header information - headers already sent by (output started at %s:%d) in %s on line %d 37NULL 38 39Warning: Cannot modify header information - headers already sent by (output started at %s:%d) in %s on line %d 40NULL 41bool(true) 42array(0) { 43} 44 45Warning: Cannot modify header information - headers already sent by (output started at %s:%d) in %s on line %d 46NULL 47 48Warning: Cannot modify header information - headers already sent by (output started at %s:%d) in %s on line %d 49NULL 50bool(true) 51array(0) { 52} 53Done 54