|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29125 ob_start('ob_gzhandler') and ob_clean() in a function.
Submitted: 2004-07-13 21:55 UTC Modified: 2004-07-14 09:45 UTC
From: justin at onyourmark dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.4 OS: FreeBSD 4.10-STABLE
Private report: No CVE-ID: None
 [2004-07-13 21:55 UTC] justin at onyourmark dot com
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:
echo "Shouldn't be displayed<br>";
test("Should be displayed<br>\n");
echo "Should be displayed too<br>";

function test($str)
	echo $str;

Expected result:
Should be displayed<br>
Should be displayed too<br>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-13 22:06 UTC] justin at onyourmark dot com
Incorrect initial listing of PHP version. Correct now.
 [2004-07-13 22:17 UTC] justin at onyourmark dot com
echo 'should not be shown';
echo 'should be shown';

This also results in nothing being displayed. Removing the ob_gzhandler results in the proper output of 'should be shown'.
 [2004-07-13 22:20 UTC] justin at onyourmark dot com
I just tested the code on a 4.3.7 box and it works, so I'm closing this bug, as it's obviously been fixed.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri May 20 18:05:43 2022 UTC