#32648 [Opn]: register_shutdown_function output corrupted if zlib.output_compression is On

From: Date: Mon, 11 Apr 2005 15:59:08 +0000
Subject: #32648 [Opn]: register_shutdown_function output corrupted if zlib.output_compression is On
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969367699@lists.php.net to get a copy of this message
ID: 32648 Updated by: sniper@php.net Reported By: interghost at crovortex dot com Status: Open -Bug Type: Output Control +Bug Type: Documentation problem Operating System: Windows XP/Linux PHP Version: 5.0.4 New Comment: Manual is wrong here. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc (#969367699) next »