Doc->Bug #66758 [Opn]: Flags and control output buffering functions
| From: | yohgaki@php.net | Date: | Mon, 07 Jul 2014 05:26:43 +0000 |
| Subject: | Doc->Bug #66758 [Opn]: Flags and control output buffering functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186494@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66758&edit=1
ID: 66758
Updated by: yohgaki@php.net
Reported by: krzysiekpiasecki at yahoo dot com
Summary: Flags and control output buffering functions
Status: Open
-Type: Documentation Problem
+Type: Bug
Package: Output Control
Operating System: MAC OS X 10.8.5
PHP Version: 5.5.8
-Assigned To:
+Assigned To: mike
Block user comment: N
Private report: N
New Comment:
Verified on my Fedora 20 with PHP 5.5.14.
This seems a bug rather than doc issue. What do you think, mike?
ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE);
echo 'AAA';
ob_end_clean();
This code does not clean buffer, raises error, then outputs 'AAA'.
Previous Comments:
------------------------------------------------------------------------
[2014-02-23 22:46:36] krzysiekpiasecki at yahoo dot com
Version is 5.5.8
------------------------------------------------------------------------
[2014-02-23 22:43:42] krzysiekpiasecki at yahoo dot com
Description:
------------
From PHP manual: PHP_OUTPUT_HANDLER_CLEANABLE const control access to functions: ob_clean(),
ob_end_clean(), and ob_get_clean().
Using ob_end_clean(), there is a notice: "ob_end_clean(): failed to discard buffer of default
output handler (1)".
Using ob_get_clean(), there is even a double notice: "ob_get_clean(): failed to delete buffer
of default output handler (1)".
I understand, that only cleanable buffer can't be flush and delete. So why in manual these
functions are under control PHP_OUTPUT_HANDLER_CLEANABLE const? I'm confused.
Test script:
---------------
ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE);
ob_end_clean();
ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE);
ob_get_clean();
Expected result:
----------------
No notice, and no buffer after function invocation.
Actual result:
--------------
ob_end_clean() produces notice:
Notice: ob_end_clean(): failed to discard buffer of default output handler (1)
ob_get_clean() produces double notice:
Notice: ob_get_clean(): failed to discard buffer of default output handler (2)
Notice: ob_get_clean(): failed to discard buffer of default output handler (2)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66758&edit=1