Doc #54639 [Asn->Csd]: output_add_rewrite_var can only be used once

From: Date: Thu, 13 Aug 2020 10:10:11 +0000
Subject: Doc #54639 [Asn->Csd]: output_add_rewrite_var can only be used once
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17771@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54639&edit=1

 ID:                 54639
 Updated by:         phpdocbot@php.net
 Reported by:        fl at nyggen dot com
 Summary:            output_add_rewrite_var can only be used once
-Status:             Assigned
+Status:             Closed
 Type:               Documentation Problem
 Package:            Output Control
 PHP Version:        Irrelevant
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=c6a8e42bdbbb814124b84d45d95cd793129aac6b
Log: Fix #54639: output_add_rewrite_var can only be used once


Previous Comments:
------------------------------------------------------------------------
[2013-09-26 15:07:06] mike@php.net

Yes, this odd output handler can only be used once.

------------------------------------------------------------------------
[2011-04-30 12:30:17] fl at nyggen dot com

Description:
------------
The output_add_rewrite_var can only be used once, the second time it fails.

More on this problem here: http://stackoverflow.com/questions/5822936/output-add-
rewrite-var-problems

Test script:
---------------
// outer buffer
ob_start();

print_r(ob_list_handlers());

// inner buffer 1
ob_start();
output_add_rewrite_var('var', 'value');
print_r(ob_list_handlers());
ob_end_flush();

print_r(ob_list_handlers());

// inner buffer 2
ob_start();
output_add_rewrite_var('var', 'value');
print_r(ob_list_handlers());
ob_end_flush();

print_r(ob_list_handlers());

Expected result:
----------------
Output should have been:

Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
Array
(
    [0] => default output handler
)

Actual result:
--------------
Output is:

Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => URL-Rewriter
)
Array
(
    [0] => default output handler
)
Array
(
    [0] => default output handler
    [1] => default output handler
)
Array
(
    [0] => default output handler
)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=54639&edit=1


Thread (2 messages)

« previous php.doc.bugs (#17771) next »