New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document details of output buffering / output control #3126
Conversation
<para> | ||
The following values will not be converted to string | ||
and have special behavior associated with them. | ||
<itemizedlist> | ||
<listitem> | ||
<para> | ||
&false; - returns the contents of the buffer | ||
</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
&true; - returns an empty string | ||
</para> | ||
</listitem> | ||
</itemizedlist> | ||
</para> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... Okay this is stupid. Maybe something to deprecate/fix on the php-src side...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the commit history of output.c
and the false
check was originally added for ob_gzhandler()
to signal to the output buffer to return the original contents of the buffer without actually copying it.
The true
check was added during the redesign of the output API without any notes on why. Returning true
does exactly the same as returning null
or an empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits, and I think we are good :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thanks! Could you also close these related bug reports? :-) https://bugs.php.net/bug.php?id=60984 |
Done :) |
Co-authored-by: haszi <haszika80@gmail.com>
The aim of this PR is to document most details of output control / output buffering.
It adds three new pages to the
outcontrol
book:flush()
and implicit flushing)I've checked all related user comments in the manual, and bugs, PR's and issues on
bugs.php.net
,php-src
anddoc-en
. Additionally, I've tested everything before I've added it to these pages (on the CLI and a web server) so everything on them at least"works on my machine"
.If accepted, these pages or sections of it could be linked to from other output control pages.
Closes https://bugs.php.net/bug.php?id=60984
Closes https://bugs.php.net/bug.php?id=65115
Related bug report that is already resolved and can be closed https://bugs.php.net/bug.php?id=78495