|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34181 Header call not possible in a shutdown function
Submitted: 2005-08-18 09:40 UTC Modified: 2005-08-18 09:58 UTC
Avg. Score:2.3 ± 0.9
Reproduced:0 of 1 (0.0%)
From: proclub at karinthy dot hu Assigned:
Status: Wont fix Package: Output Control
PHP Version: 4.4.0 OS: Windows 2000
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.
Block user comment
Status: Assign to:
Bug Type:
From: proclub at karinthy dot hu
New email:
PHP Version: OS:


 [2005-08-18 09:40 UTC] proclub at karinthy dot hu
When calling the header() function in a function registred with register_shutdown_function(), PHP issues a warning as it there had been an output before.

Reproduce code:

 function destructor()
  header("HTTP/1.1 200 OK");

Expected result:
The header correctly inserted in the output.

Actual result:
Warning: Cannot modify header information - headers already sent in g:\[...]\bugtest.php on line 6


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-18 09:58 UTC]
This behaviour was changed in 5.1, but it won't be changed in 4.4 & 5.0 for BC reasons.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue May 30 08:03:39 2023 UTC