|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-07-13 21:55 UTC] justin at onyourmark dot com
Description:
------------
The output buffer stops working if:
1) the output buffer was started with ob_start('ob_gzhandler');
2) a ob_clean() call is made from within a function.
Any subsequent ob_flush()/ob_end_flush()/ob_get_contents(), ect results in nothing being returned.
Bug #24951 seems to be similar to the problem I'm having. I'll run similar tests and report back the results, unless the issue is positivly identified before I finish the tests.
Reproduce code:
---------------
<?php
ob_start('ob_gzhandler');
echo "Shouldn't be displayed<br>";
test("Should be displayed<br>\n");
echo "Should be displayed too<br>";
ob_end_flush();
function test($str)
{
ob_clean();
echo $str;
}
?>
Expected result:
----------------
Should be displayed<br>
Should be displayed too<br>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 07:00:01 2025 UTC |
<?php ob_start('ob_gzhandler'); echo 'should not be shown'; ob_clean(); echo 'should be shown'; ob_end_flush(); ?> This also results in nothing being displayed. Removing the ob_gzhandler results in the proper output of 'should be shown'.