|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25988 ob_start (); can't register CLASS method as a callback function
Submitted: 2003-10-26 03:32 UTC Modified: 2003-10-26 12:37 UTC
From: MDonatas at centras dot lt Assigned:
Status: Not a bug Package: Output Control
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: MDonatas at centras dot lt
New email:
PHP Version: OS:


 [2003-10-26 03:32 UTC] MDonatas at centras dot lt
ob_start (); can't register CLASS method as a callback function.

Reproduce code:
class test
  function test () //constructor
    ob_start ("$this->callback"); //or simply "callback"
    echo 'Some output.';
    echo ob_get_clean ();
  function callback ($info) //this function isn't called
    return $info.' stuff';

$tmp = new test;

Expected result:
callbackfunction (class method) to be called;

Actual result:
It's not called :/


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-26 12:37 UTC]
Reread the docs. Callbacks with methods are done
with arrays. array(class,method) for static methods and array(object,method) for non static ones.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 19:01:27 2023 UTC