php.net |  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
Votes:3
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: proclub at karinthy dot hu
New email:
PHP Version: OS:

 

 [2005-08-18 09:40 UTC] proclub at karinthy dot hu
Description:
------------
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:
---------------
<?php
 register_shutdown_function('destructor');

 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-18 09:58 UTC] tony2001@php.net
This behaviour was changed in 5.1, but it won't be changed in 4.4 & 5.0 for BC reasons.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 19:01:23 2020 UTC