|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
35 - 28 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 15:01:32 2024 UTC