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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 03:02:51 2024 UTC