php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34544 shutdown_function is called with header already sent
Submitted: 2005-09-18 23:36 UTC Modified: 2005-09-27 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: panard at inzenet dot org Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.0.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: panard at inzenet dot org
New email:
PHP Version: OS:

 

 [2005-09-18 23:36 UTC] 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 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-19 07:33 UTC] derick@php.net
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
 [2005-09-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 19:03:44 2022 UTC