#34544 [Opn->Fbk]: shutdown_function is called with header already sent
| From: | derick@php.net | Date: | Mon, 19 Sep 2005 05:33:22 +0000 |
| Subject: | #34544 [Opn->Fbk]: shutdown_function is called with header already sent | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85220@lists.php.net to get a copy of this message | ||
ID: 34544
Updated by: derick@php.net
Reported By: panard at inzenet dot org
-Status: Open
+Status: Feedback
Bug Type: *General Issues
Operating System: Linux
PHP Version: 5.0.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-09-18 23:36:55] panard at inzenet dot org
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 this bug report at http://bugs.php.net/?id=34544&edit=1