php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23489 ob_start() is broken with method callbacks
Submitted: 2003-05-05 04:59 UTC Modified: 2003-05-07 15:43 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: davey@php.net Assigned: helly (profile)
Status: Closed Package: Output Control
PHP Version: 4.2.3 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: davey@php.net
New email:
PHP Version: OS:

 

 [2003-05-05 04:59 UTC] davey@php.net
 The following code

    <?php
    class Test {
      function Test() {
        ob_start(
          array(
            $this, 'transform'
          )
        );
      }

      function transform($buffer) {
        return 'bar';
      }
    }

    $t = new Test;
    ?>
    foo

 outputs 'bar', as it is expected to do, with PHP 4.3.1.

 With PHP 4.3.2-RC and PHP 5.0.0-dev it outputs 'foo' which is just
 plain wrong.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-05 15:01 UTC] moriyoshi@php.net
Definitely related to bug #23466.

OG(active_ob_buffer).output_handler seems totally cluttered at the time php_end_ob_buffer() is called.

 [2003-05-05 17:37 UTC] helly@php.net
In 4 this is fixed now. The problem is still in 5. That is due to the problem that we have a different oo model in 5 (i guess).
 [2003-05-07 15:39 UTC] davey@php.net
I've tested this bug using the script seb wrote.

I've tested with PHP 4.2.2, 4.3.2RC2 and latest 4.3.2 snapshot (200305071630)

4.2.2 outputs:
Apache: bar
CGI: bar

4.3.2RC2 outputs:
Apache: bar
CLI: bar
CGI: foo

4.3.2 Snapshot outputs:
Apache: bar
CLI: bar
CGI: bar

Seems to be fixed in 4.3.2-Win32 now.

- Davey
 [2003-05-07 15:42 UTC] edink@php.net
Its fixed in 5.0.0-dev so closing the report.
 [2003-05-07 15:43 UTC] davey@php.net
sorry, I'm using Apache 1.3.27, with apache as SAPI not CGI, and WinXP without SP1. CGI tests were done from 'DOS'

- Davey
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jun 03 09:01:26 2025 UTC