alphard Posted March 24, 2007 Share Posted March 24, 2007 Hi, I deal with this: I need to call a method of an object which (both) names are decided in run-time and I need to pass it some arguments that come as a comma separated list (string). Note that I cannot change the code of the called method so I cannot use the func_num_args() etc stuff (still I can get the number of argument by Reflection). I'd like it to look like this ... (actually it's more complicated as I use an array of objects to which I reffer) function router($object, $method, $params) { $object->$method($params); } ... router("myobject","mymethod","param1,param2,param3"); Link to comment https://forums.phpfreaks.com/topic/44137-calling-a-run-time-def-method-with-variable-para-no-without-func_num_args-etc/ Share on other sites More sharing options...
alphard Posted March 25, 2007 Author Share Posted March 25, 2007 Actually ... it would be maybe enough without objects ... simple call a function Link to comment https://forums.phpfreaks.com/topic/44137-calling-a-run-time-def-method-with-variable-para-no-without-func_num_args-etc/#findComment-214802 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.