|  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
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
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();

  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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-21 09:18 UTC]
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-2023 The PHP Group
All rights reserved.
Last updated: Fri Jun 09 11:03:41 2023 UTC