php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #26238 flush() doesn't work with output_buffering = 4096
Submitted: 2003-11-13 08:40 UTC Modified: 2004-09-16 16:44 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: spam at vrana dot cz Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS, 5CVS OS: *
Private report: No CVE-ID: None
 [2003-11-13 08:40 UTC] spam at vrana dot cz
Description:
------------
I have set output_buffering = 4096 and flush(), ob_implicit_flush(), ob_flush() and similar functions doesn't work. This is reproducible in PHP Apache module, in PHP-CLI and also on Linux.

Reproduce code:
---------------
while (true) {
	echo ".";
	flush();
	sleep(1);
}


Expected result:
----------------
. (1 second) . (1 second) ...

Actual result:
--------------
nothing (for output_buffering seconds)

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-17 13:14 UTC] scottm at spamcop dot net
Confirmed.

If you set output_buffering = 3 then it will flush them in groups of three.

Running RH9, Apache 1.3.29 and PHP 4.3.4
 [2004-02-18 17:19 UTC] sniper@php.net
Here's nice and short reproduce script:

# php -d'output_buffering=2' -r 'while(1) {echo "."; flush(); sleep(1); }'


 [2004-02-18 18:33 UTC] scottmacvicar at ntlworld dot com
Setting output_buffering to a value causes it to create an ouput buffer on startup using the default output handler. You can see this using print_r(ob_get_status()); within the script.

ob_flush() should be used in this case rather than flush() since the latter only calls the backends flush method. So i believe this bug is bogus, though it could be a documentation problem.
 [2004-05-27 16:50 UTC] spam at vrana dot cz
PHP-CLI has output_buffering always Off as of 4.3.5. For the others it seems that output is flushed if both flush() and ob_flush() are called.
 [2004-09-16 16:44 UTC] vrana@php.net
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.

flush(): "You need to call both ob_flush() and flush() to flush the output buffers."

output_buffering: "As of PHP 4.3.5, this directive is always Off in PHP-CLI."

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 07:01:28 2024 UTC