class Foo {
public function __call($function, $arguments)
{
return "$function has been called with arguments: " . implode(', ', $arguments);
}
// public function fireFunction($one, $two, $three) {
// return "pre-defined method";
// }
}
$foo = new Foo();
echo $foo->fireFunction(5, 47, "third argument");
__call
is invoked when the method is inaccessible (when it's not public or does not exist at all)