Bug->Doc #69404 [Asn->Opn]: PHP_OUTPUT_HANDLER_FLUSHABLE only affects ob_flush()
| From: | mike@php.net | Date: | Mon, 13 Apr 2015 15:01:55 +0000 |
| Subject: | Bug->Doc #69404 [Asn->Opn]: PHP_OUTPUT_HANDLER_FLUSHABLE only affects ob_flush() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12142@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69404&edit=1
ID: 69404
Updated by: mike@php.net
Reported by: tstarling@php.net
-Summary: ob_get_flush() and ob_end_flush() do not check
PHP_OUTPUT_HANDLER_FLUSHABLE
+Summary: PHP_OUTPUT_HANDLER_FLUSHABLE only affects ob_flush()
-Status: Assigned
+Status: Open
-Type: Bug
+Type: Documentation Problem
Package: Output Control
Operating System: Any
PHP Version: 5.5Git-2015-04-09 (Git)
-Assigned To: mike
+Assigned To:
Block user comment: N
Private report: N
New Comment:
Actually none of these is a "flush" as in ob_flush(), where the output buffer stays on the
stack.
Both ob_get_flush() and ob_end_flush() actually finish the output buffer/handler.
Naming of the userland API is ambiguous, but you can see in the output.c sources, that both of these
functions actually call php_output_end() and not php_output_flush().
Reclassifying as "Doc Bug", wrt PHP_OUTPUT_HANDLER_FLUSHABLE only affects ob_flush().
Thanks anyway!
Previous Comments:
------------------------------------------------------------------------
[2015-04-09 06:44:33] tstarling@php.net
Description:
------------
According to the manual, ob_get_flush() and ob_end_flush() should fail if
PHP_OUTPUT_HANDLER_FLUSHABLE was not given during ob_start(). That seems like a sensible policy, but
the flag is only checked during ob_flush().
I noticed this bug while reading output.c, I don't actually use those functions.
Test script:
---------------
<?php
ob_start(null, 0, PHP_OUTPUT_HANDLER_REMOVABLE);
print "x\n";
var_dump(ob_get_flush());
Expected result:
----------------
PHP Notice: ob_get_flush(): failed to flush buffer of default output handler (0) in
ob_get_flush.php on line 4
bool(false)
x
Actual result:
--------------
x
string(2) "x
"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69404&edit=1