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
 [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

Pull Requests

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: Thu Dec 05 02:01:30 2024 UTC