Doc #60243 [Asn->Csd]: Add way to specify output buffering chunk size of 1
| From: | aharvey@php.net | Date: | Fri, 11 Nov 2011 13:18:20 +0000 |
| Subject: | Doc #60243 [Asn->Csd]: Add way to specify output buffering chunk size of 1 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7415@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60243&edit=1
ID: 60243
Updated by: aharvey@php.net
Reported by: artificialmagic at hotmail dot com
Summary: Add way to specify output buffering chunk size of 1
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.8
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2011-11-11 13:18:06] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=319051
Log: Fix doc bug #60243 (Add way to specify output buffering chunk size of 1).
------------------------------------------------------------------------
[2011-11-11 13:13:08] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=319050
Log: Note the change in ob_start() chunk size behaviour mentioned in doc bug #60243
(Add way to specify output buffering chunk size of 1).
------------------------------------------------------------------------
[2011-11-11 13:11:18] aharvey@php.net
This has actually been fixed in PHP 5.4 already as part of the output layer
improvements: a chunk size of 1 now really means 1.
I'll morph this into a documentation bug, because it's currently not noted in the
manual or in the upgrade notes.
------------------------------------------------------------------------
[2011-11-08 15:19:57] artificialmagic at hotmail dot com
Here's a proper test script. This produces [4096][4096][4096][4096][4096]...
ob_start(function($x) { return '[' . strlen($x) . ']'; }, 1);
for (;;) echo '.';
So I'd like this to produce [1][1][1][1][1][1]....
ob_start(function($x) { return '[' . strlen($x) . ']'; }, -1);
for (;;) echo '.';
------------------------------------------------------------------------
[2011-11-08 15:16:14] artificialmagic at hotmail dot com
Description:
------------
ob_implicit_flush does not do anything in CLI. This script never produces output:
ob_start();
ob_implicit_flush(true);
for (;;) echo '.';
A 1-byte buffer would work around it, except that specifying a chunk_size of 1 to ob_start is taken
to mean 4 kilobytes. As a workaround, please make a chunk_size of -1 to ob_start a synonym for a
real 1, so that output buffering can be used for filtering or for redirection without actual delay
in output. Currently the smallest size that can be specified is 2 bytes, which can cause a
potentially infinite wait for an extra byte.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60243&edit=1