php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19654 function to call class methods
Submitted: 2002-09-28 17:30 UTC Modified: 2003-02-24 01:00 UTC
Votes:4
Avg. Score:2.8 ± 1.8
Reproduced:3 of 4 (75.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: goba@php.net Assigned:
Status: No Feedback Package: Feature/Change Request
PHP Version: 4.2.3 OS: n/a
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:
MUST BE VALID
Solve the problem:
33 - 5 = ?
Subscribe to this entry?

 
 [2002-09-28 17:30 UTC] goba@php.net
We have $$objname->$methodname() for dinamic method calls, and even call_user_func(array(&$$objname, $methodname), but we have no $classname::$methodname() or call_class_method($classname, $methodname) or anything like this. It would be nice to call class methods dinamicaly, as many times classes are used for namespace resons, and there is no need to have instances of them.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-08 13:20 UTC] moriyoshi@php.net
Did you mean the same thing as how this script works?

<?php
    class test {
        function foo() {
            echo "foo\n";
        }
        function bar() {
            echo "bar\n";
        }
    }
    call_user_func(array('test', 'foo'));
    call_user_func(array('test', 'bar'));
?>

 [2003-02-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 13:01:30 2024 UTC