How do I make a truely dynamic function with dynamic parameters call? The documentation and examples I've found all assume you have only 1 parameter. I would like to have multiple parameters, example:
class Object {
function A($p1) {}
function B($p1,$p2) {}
}
$obj = new Object();
$function = "B";
$params = "'foo', 'me'";
$obj->$function($params);
calling $function = "A" will be fine as $params is treated as a string. I've tried
$obj->$function(explode(',',$params));
for $function="B" but it does not work as explode simply returns
an array and thus function B has a missing parameter.
Any idea?