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
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: goba@php.net
New email:
PHP Version: OS:

 

 [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 02:01:28 2024 UTC