Bug #74224 [Opn->Wfx]: output_add_rewrite_var always starts a new output buffer
| From: | mike@php.net | Date: | Thu, 14 Jun 2018 10:35:47 +0000 |
| Subject: | Bug #74224 [Opn->Wfx]: output_add_rewrite_var always starts a new output buffer | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215715@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74224&edit=1
ID: 74224
Updated by: mike@php.net
Reported by: bernd dot jaenichen at questback dot com
Summary: output_add_rewrite_var always starts a new output
buffer
-Status: Open
+Status: Wont fix
Type: Bug
Package: Output Control
Operating System: openSUSE 13.2 (i586)
PHP Version: 5.6.30
Block user comment: N
Private report: N
New Comment:
You said:
> Manual states that this should be the case only if no buffering is active.
Did you mean this note from the manual?
>> Note: Calling this function will implicitly start output buffering if it is not active
>> already.
You're right, it could be interpreted that way.
Unfortunately I didn't interpret it that way 10 years ago when rewriting the output layer.
Previous Comments:
------------------------------------------------------------------------
[2017-09-14 17:59:52] cmb@php.net
According to <https://3v4l.org/oIpdo>, the behavior has
been
changed as of PHP 5.4.0 which may have been done deliberately, in
which case this would be a documentation problem.
------------------------------------------------------------------------
[2017-03-08 13:47:58] bernd dot jaenichen at questback dot com
Description:
------------
---
From manual page: http://www.php.net/function.output-add-rewrite-var
---
If ob_start() has already been called and output_add_rewrite_var() is called after that it leads to
ob_get_level() == 2.
Manual states that this should be the case only if no buffering is active.
Bug is reproducable in CLI as well as CGI mode.
Test script:
---------------
<?PHP
ob_start();
echo "Fill buffer\n";
output_add_rewrite_var('someParam', 1);
echo "Level: " . ob_get_level() . "\n";
echo ob_get_clean();
Expected result:
----------------
Fill buffer
Level: 1
Actual result:
--------------
Fill buffer
Level: 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74224&edit=1