php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22866 Variable function call on object method fails
Submitted: 2003-03-25 00:36 UTC Modified: 2003-04-21 09:18 UTC
Votes:4
Avg. Score:3.2 ± 1.5
Reproduced:2 of 3 (66.7%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: tys at cs dot ualberta dot ca Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 4.3.1 OS: Linux
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: tys at cs dot ualberta dot ca
New email:
PHP Version: OS:

 

 [2003-03-25 00:36 UTC] tys at cs dot ualberta dot ca
A variable function can be called on a normal function just fine:
------------------------------
function test()
{
   return "test1";
}

$function = "test";
echo $function();
------------------------------
This outputs: test

However trying the same thing on a funciton inside a class will fail:
------------------------------
class Test
{
  function Test()
  {
  }

  function testClass()
  {
    return "test 2";
  }
}

$function = "Test::testClass";
echo $function();
------------------------------

Calling:
  echo Test::testClass();
works fine, however the above code does not.  It should output: test 2

However it returns an error similar to the following:
Fatal error: Call to undefined function: registration::formatdate() in /home/gaza/public_html/fp_php/support/table.php on line 396

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-21 09:18 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 01:01:28 2024 UTC