I am coding a server with a lot of method. To avoid doing a $this->check_auth() call (and others similar processing) in _each_ on my method, I was looking for a way to wrap them all through a dispatch.
Combining _call, with call_user_func_array is the way I did it finally.
So basically, if you want to call "testFunc" you just call $class->test () and
it will be wrapped and testFunc will be executed.
function __call($method, $param)
return (call_user_func_array (array ("MytestClass", $method."Func"), $param));
function testFunc($param, $arg)
echo "It works ! Param: $param, ARG=$arg\n";
$test = new MytestClass;
$test->test ("Cool", "Test");