Bug #71486 [NEW]: Output handler flags for ob_end_clean and ob_end_flush
| From: | php at login dot hedim dot ch | Date: | Sat, 30 Jan 2016 15:56:58 +0000 |
| Subject: | Bug #71486 [NEW]: Output handler flags for ob_end_clean and ob_end_flush | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-198970@lists.php.net to get a copy of this message | ||
From: php at login dot hedim dot ch
Operating system:
PHP version: 5.6.17
Package: Output Control
Bug Type: Bug
Bug description:Output handler flags for ob_end_clean and ob_end_flush
Description:
------------
According to http://php.net/manual/en/function.ob-end-clean.php:
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 http://php.net/manual/en/function.ob-end-flush.php:
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:
---------------
ob_start(null, 0, PHP_OUTPUT_HANDLER_REMOVABLE);
echo "1";
ob_end_clean();
echo "2";
Expected result:
----------------
A notice from ob_end_clean() and output "12"
Actual result:
--------------
Output "2"
--
Edit bug report at https://bugs.php.net/bug.php?id=71486&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71486&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71486&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71486&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71486&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71486&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71486&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71486&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71486&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71486&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71486&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71486&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71486&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71486&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71486&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71486&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71486&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71486&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71486&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71486&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71486&r=mysqlcfg