|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71486 Output handler flags for ob_end_clean and ob_end_flush
Submitted: 2016-01-30 15:56 UTC Modified: 2016-03-09 15:32 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: php at login dot hedim dot ch Assigned:
Status: Open Package: Output Control
PHP Version: 5.6.17 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 - 17 = ?
Subscribe to this entry?

 [2016-01-30 15:56 UTC] php at login dot hedim dot ch
According to The output buffer must be started by ob_start() with PHP_OUTPUT_HANDLER_CLEANABLE and PHP_OUTPUT_HANDLER_REMOVABLE flags. Otherwise ob_end_clean() will not work.

However, ob_end_clean() seems to work with only PHP_OUTPUT_HANDLER_REMOVABLE.

According to The output buffer must be started by ob_start() with PHP_OUTPUT_HANDLER_FLUSHABLE and PHP_OUTPUT_HANDLER_REMOVABLE flags. Otherwise ob_end_flush() will not work.

However, ob_end_flush() seems to work with only PHP_OUTPUT_HANDLER_REMOVABLE.

The test script below shows the problem with ob_end_clean(). To see the problem with ob_end_flush(), simply replace ob_end_clean() with ob_end_flush().

Test script:
echo "1";
echo "2";

Expected result:
A notice from ob_end_clean() and output "12"

Actual result:
Output "2"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-09 15:28 UTC]
-Type: Bug +Type: Documentation Problem
 [2016-03-09 15:28 UTC]
Actually, PHP_OUTPUT_HANDLER_CLEANABLE is only needed for `ob_clean()` because that's the only operation, that would leave the output handler alive instead of destroying and popping it off the stack.
 [2016-03-09 15:32 UTC]
See also #69404
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Apr 05 01:01:24 2020 UTC