execute methods dynamically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everybody,

I want to write a method in version 4 that executes a method of an object.
As parameter the classname and the methodname is passed:

function executeMethod($classname, $methodname) {
	$object = new $classname();
	$object->$methodname();
}

This does not work. What am I doing wrong?

Greetings,
-Rainer Hahnekamp

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux