# Showstopper: ob_start() is b0rked

- Thread: https://externals.io/message/1257
- Original archive: https://news-web.php.net/php.internals/1257
- Started by Zeev Suraski on 2003-05-05T11:18:12+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #1257 — Zeev Suraski — 2003-05-05T11:18:12+00:00

URL: https://externals.io/message/1257#1257

Did you try to reduce it to a simpler structured example and see if it has 
to do with OO, or is it a 100% output buffering issue?

Zeev

At 11:25 05/05/2003, Sebastian Bergmann wrote:
>   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.
>
>--
>   Sebastian Bergmann
>   http://sebastian-bergmann.de/                 http://phpOpenTracker.de/
>
>   Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

---

## #1262 — Sebastian Bergmann — 2003-05-05T11:27:26+00:00

URL: https://externals.io/message/1257#1262 · In reply to: #1257

Zeev Suraski wrote:
> Did you try to reduce it to a simpler structured example and see if it
> has to do with OO, or is it a 100% output buffering issue?

  I reduced it from the XML_Transformer_Driver_OutputBuffer class already
  to the code I posted.

  I'm not 100% sure but I think a "normal" function works as a callback
  for `ob_start()` -- so maybe it's a OO issue.

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/                 http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

---

## #1261 — Edin Kadribasic — 2003-05-05T11:31:26+00:00

URL: https://externals.io/message/1257#1261 · In reply to: #1257

> Did you try to reduce it to a simpler structured example and see if it has 
> to do with OO, or is it a 100% output buffering issue?

Procedural example works as expected. It seems that ob_start(array(object, 
method)) is the one causing problems.

Edin
