#22713 [Fbk->Opn]: Strange HTTP headers behaviour when using output buffering and callback
| From: | public at asd-group dot com | Date: | Sat, 15 Mar 2003 03:28:01 +0000 |
| Subject: | #22713 [Fbk->Opn]: Strange HTTP headers behaviour when using output buffering and callback | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-35652@lists.php.net to get a copy of this message | ||
ID: 22713
User updated by: public at asd-group dot com
Reported By: public at asd-group dot com
-Status: Feedback
+Status: Open
Bug Type: HTTP related
Operating System: Windows XP
PHP Version: 4.3.1
New Comment:
What information do you want - I can't think of anything else that
might be relevant ???
Previous Comments:
------------------------------------------------------------------------
[2003-03-14 19:20:39] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2003-03-14 15:21:25] public at asd-group dot com
I'm using output buffering with a callback specified in ob_start. I'm
also using the second parameter of value 2 (callback gets called each
time output occurs in the application, rather than just once when the
whole output buffer is flushed).
My callback always returns an empty string, telling PHP to ignore the
output, however as soon as this happens (ie. first 'echo' or 'print'
statement in application) headers_sent starts to return true.
However the HTTP headers (and terminating blank line) cant have been
sent because my own calls to header() later on (eg. to set cookies)
still work.
Also, due to this, any code which expects output buffering to be on,
and which checks headers_sent() before sending its own headers (after
doing HTML output) will break using output buffering this way.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22713&edit=1