|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64212 Ability to reference an active output buffer stack.
Submitted: 2013-02-14 13:47 UTC Modified: 2013-10-15 11:54 UTC
From: aleksandr dot makov at gmail dot com Assigned:
Status: No Feedback Package: Output Control
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: aleksandr dot makov at gmail dot com
New email:
PHP Version: OS:


 [2013-02-14 13:47 UTC] aleksandr dot makov at gmail dot com
Since we have ob_get_level() we kind of miss ability to reference that stack from 
nested active stacks. In recursive content generators this will avoid the need to 
loop through the final output to determine the bounds of nested stacks and do 
operations with that(those) segment(s), such as replacement and so on.

Test script:
echo "111"; // <-- this is the stack of interest
echo "22";
echo "3";
$cur_stack_len = ob_get_length(); // length of current stack (level 3) is 1
$top_stack_len = get_length_of_ob_stack_by_level(1); // expected length here should be 3 (strlen("111") == 3)
echo "some more chars to change length of stack 1";
echo $top_stack_len; // I'm expecting to see 3 here.

Expected result:

Actual result:
not implemented


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-30 19:11 UTC]
-Status: Open +Status: Feedback
 [2013-07-30 19:11 UTC]
How about ob_get_status(true) in PHP-5.4+?
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2013-11-04 20:28 UTC] aleksandr dot makov at gmail dot com
Hi. Can't see how I could get ob_get_status(TRUE); to help me to find the stack length. It has size value, but it's quite undocumented to see if it's what I need. Anyway — my goal is to be able to reach the ob "slice" so far. But I have to look into ob_get_status(TRUE) first.
Thanks for the follow up.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 22:01:27 2024 UTC