php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67341 flush() documentation misleading
Submitted: 2014-05-25 23:55 UTC Modified: 2014-12-30 05:05 UTC
From: chealer at gmail dot com Assigned: mike (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chealer at gmail dot com
New email:
PHP Version: OS:

 

 [2014-05-25 23:55 UTC] chealer at gmail dot com
Description:
------------
The synopsis for flush() is "flush — Flush the output buffer". The description starts "Flushes the write buffers of PHP and whatever backend PHP is using (CGI, a web server, etc)."

This is quite misleading. The documentation latter explains:
" It also doesn't affect PHP's userspace output buffering mechanism. This means you will have to call both ob_flush() and flush() to flush the ob output buffers if you are using those. "

Therefore, there may be more than a single output buffer. I do not perfectly understand all buffers involved and I'm not sure about the terminology. What is the antonym of "userspace"? Quickly, I'd suggest:
flush — Flush system output buffers
"Flushes the system write buffer of PHP and, as much as possible, any write buffer of whatever backend PHP is using (CGI, a web server, etc)."

---
From manual page: http://www.php.net/function.flush
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-06 00:49 UTC] yohgaki@php.net
Automatic comment from SVN on behalf of yohgaki
Revision: http://svn.php.net/viewvc/?view=revision&revision=334135
Log: Fixed bug #67341
 [2014-11-19 12:20 UTC] mike@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mike
 [2014-12-30 05:05 UTC] chealer at gmail dot com
I still consider the sentence "Flushes the system write buffers of PHP and whatever backend PHP is using (CGI, a web server, etc)." as misleading, since:
"Several servers, especially on Win32, will still buffer the output from your script until it terminates before transmitting the results to the browser.

Server modules for Apache like mod_gzip may do buffering of their own that will cause flush() to not result in data being sent immediately to the client."


But thanks, it's less problematic now.
 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=cd1472667a1dd20ae48c06a2517d1452cc9d3413
Log: Fixed bug #67341
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 17:01:33 2025 UTC