[DOC-CVS] [doc-en] master: Clarify ob_get_status buffer_size and ob_start chunk_size behavior (#5260)
[email protected] (Louis-Arnaud via GitHub)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-08-24T10:25:20+02:00
Commit: https://github.com/php/doc-en/commit/1ebafd8a44786824396f95102576426462835869
Raw diff: https://github.com/php/doc-en/commit/1ebafd8a44786824396f95102576426462835869.diff
Clarify ob_get_status buffer_size and ob_start chunk_size behavior (#5260)
Changed paths:
M reference/outcontrol/functions/ob-get-status.xml
M reference/outcontrol/functions/ob-start.xml
Diff:
diff --git a/reference/outcontrol/functions/ob-get-status.xml b/reference/outcontrol/functions/ob-get-status.xml
index 20b8ab88b937..687002bcc47f 100644
--- a/reference/outcontrol/functions/ob-get-status.xml
+++ b/reference/outcontrol/functions/ob-get-status.xml
@@ -107,7 +107,14 @@
<seglistitem>
<seg>buffer_size</seg>
<seg>
- Output buffer size in bytes
+ Currently allocated size of the output buffer in bytes.
+ It starts at <literal>16384</literal> bytes with the default
+ <parameter>chunk_size</parameter>, or at
+ <parameter>chunk_size</parameter> rounded up to the next multiple of
+ <literal>4096</literal> when one is given, and grows in multiples of
+ <literal>4096</literal> as more output is buffered.
+ This is not the amount of data in the buffer (see
+ <literal>buffer_used</literal>).
</seg>
</seglistitem>
<seglistitem>
diff --git a/reference/outcontrol/functions/ob-start.xml b/reference/outcontrol/functions/ob-start.xml
index 1239b0cc0b58..d50a84aca340 100644
--- a/reference/outcontrol/functions/ob-start.xml
+++ b/reference/outcontrol/functions/ob-start.xml
@@ -111,15 +111,22 @@
<varlistentry>
<term><parameter>chunk_size</parameter></term>
<listitem>
- <para>
+ <simpara>
If the optional parameter <parameter>chunk_size</parameter> is passed,
the buffer will be flushed after any block of code resulting in output
that causes the buffer's length to equal
or exceed <parameter>chunk_size</parameter>.
The default value <literal>0</literal> means
that all output is buffered until the buffer is turned off.
+ A value of <literal>1</literal> means the buffer will be flushed
+ after every output operation, effectively disabling buffering.
+ <parameter>chunk_size</parameter> also determines the initial size of
+ the buffer reported by <function>ob_get_status</function>:
+ <literal>16384</literal> bytes when it is <literal>0</literal>, and
+ <parameter>chunk_size</parameter> rounded up to the next multiple of
+ <literal>4096</literal> otherwise.
See <xref linkend="outcontrol.buffer-size"/> for more details.
- </para>
+ </simpara>
</listitem>
</varlistentry>
<varlistentry>