|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-11 17:59 UTC] sniper@php.net
[2005-04-12 10:08 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 13:00:01 2025 UTC |
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