From: panard at inzenet dot org Operating system: Linux PHP version: 5.0.5 PHP Bug Type: *General Issues Bug description: shutdown_function is called with header already sent
Description: ------------ when the registered shutdown_function is called, headers are already sent and they only contain : "X-Powered-By" Reproduce code: --------------- <?php function print_document() { if ( headers_sent() ) { var_dump( headers_list() ); } header( "Content-Type: text/xml" ); } register_shutdown_function( 'print_document' ); ?> Expected result: ---------------- No warning Actual result: -------------- array(1) { [0]=> string(12) "X-Powered-By" } Warning: Cannot modify header information - headers already sent by (output started at /home/panard/public_html/bugs/register_shutdown_function.php:5) in /home/panard/public_html/bugs/register_shutdown_function.php on line 7 -- Edit bug report at http://bugs.php.net/?id=34544&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34544&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34544&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34544&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34544&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34544&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34544&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34544&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34544&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34544&r=support Expected behavior: http://bugs.php.net/fix.php?id=34544&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34544&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34544&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34544&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34544&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34544&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34544&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34544&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34544&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34544&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34544&r=mysqlcfg