I suppose you could use one of these approaches, though you should note that [man]call_user_method_array/man is deprecated.
<?php
class CallMe
{
public function foo($val1, $val2)
{
echo "$val1 $val2";
}
}
class Test
{
public function instantiateIt($class, $method, $args)
{
call_user_method_array($method, new $class, $args);
}
public function receiveIt($obj, $method, $args)
{
call_user_method_array($method, $obj, $args);
}
}
$test = new Test();
$test->instantiateIt('CallMe', 'foo', array("Hello, ", "World!"));
echo "<br>";
$test->receiveIt(new CallMe(), 'foo', array("Goodbye, ", "cruel world."));