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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC