php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: MDonatas at centras dot lt
New email:
PHP Version: OS:

 

 [2003-10-26 03:32 UTC] MDonatas at centras dot lt
Description:
------------
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 :/

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-26 12:37 UTC] helly@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 11:01:28 2024 UTC