|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19711 fflush doesn't flushes to a file
Submitted: 2002-10-02 06:44 UTC Modified: 2002-10-02 07:08 UTC
From: thomasdkeller at web dot de Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.2.2 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2002-10-02 06:44 UTC] thomasdkeller at web dot de
Hi there!

It _may_ be a bug, but i'm not sure, if I have anything forgot to write down, nevertheless the following code

for($i=0;$i<1000;$i++) {
	echo "foo ";
$fp = fopen("tmp.txt","w+");

does _not_ work like my intention was (create new file called tmp.txt, flush output (1000 times "foo ") into it and close the file).

Instead of this it takes longer than normal to execute the script, then it flushes the output to the browser, creates a new file and leaves it empty (obviously fflush returns "1" for successful).

I've searched the internet, didn't found anything. Also your documentation has no example for this function (if I coded it wrong).

My system: Apache 1.3.26. PHP (with standard Out-Of-The-Box modules) as module, all read/ write access

Thanks in advance,
Thomas Keller.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-02 07:07 UTC] thomasdkeller at web dot de
Also tested this under IIS and Win2k Server, same problem.
 [2002-10-02 07:08 UTC]
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit

Thank you for your interest in PHP.

fflush() is for flushing buffered fwrite() requests
like flush() flushes echo or print outputs to standard output

what you are looking for is
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun May 19 12:01:26 2019 UTC