#19654 [Opn->Fbk]: function to call class methods

From: Date: Sat, 08 Feb 2003 19:20:52 +0000
Subject: #19654 [Opn->Fbk]: function to call class methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32512@lists.php.net to get a copy of this message
ID: 19654 Updated by: moriyoshi@php.net Reported By: goba@php.net -Status: Open +Status: Feedback Bug Type: Feature/Change Request Operating System: n/a PHP Version: 4.2.3 New Comment: 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')); ?> Previous Comments: ------------------------------------------------------------------------ [2002-09-28 17:30:46] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19654&edit=1

« previous php.bugs (#32512) next »