ID:               32648
 Updated by:       [EMAIL PROTECTED]
 Reported By:      interghost at crovortex dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Windows XP/Linux
 PHP Version:      5.0.4
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

"Shutdown function is called after closing all opened output buffers
thus, for example, its output will not be compressed if
zlib.output_compression is enabled."


Previous Comments:
------------------------------------------------------------------------

[2005-04-11 17:59:06] [EMAIL PROTECTED]

Manual is wrong here.


------------------------------------------------------------------------

[2005-04-09 21:17:08] interghost at crovortex dot com

Description:
------------
When using an echo/print inside a function called by
register_shutdown_function, AND while zlib.output_compression is set to
On, the last part of the output (whatever was echoed/printed in the
shutdown function) isn't compressed. 

PS:
I've found that this bug was already reported before but was classified
as "Bogus" with the explanation:
"The registered shutdown functions are called after the request has
been completed (including sending any output buffers), so it is not
possible to send output to the browser using echo() or print(), or
retrieve the contents of any output buffers using ob_get_contents()."

However it clearly states in the manual that:
"...Since PHP 4.1, the shutdown functions are called as the part of the
request so that it's possible to send the output from them..."

Reproduce code:
---------------
function blah()
{
        echo "Shut down";
}
register_shutdown_function('blah');
echo "testing bug<p>";

Expected result:
----------------
testing bug<p>Shut down

Actual result:
--------------
With zlib.output_compression set to On in php.ini
In Mozilla based browsers:
testing bug<p>

In IE:
an empty document

The difference above is because of different error handling in the
browsers (I think) where Mozilla simply truncates the corrupted part
while IE displays nothing

Note: Set zlib.output_compression to Off and both browsers will
display:
testing bug<p>Shut down


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32648&edit=1

Reply via email to