We can do black magic, which is useful in templating block calls:
<?php
$object->__named('methodNameHere', array('arg3' => 'three', 'arg1' => 'one'));
...
public function __named($method, array $args = array())
{
$reflection = new ReflectionMethod($this, $method);
$pass = array();
foreach($reflection->getParameters() as $param)
{
if(isset($args[$param->getName()]))
{
$pass[] = $args[$param->getName()];
}
else
{
$pass[] = $param->getDefaultValue();
}
}
return $reflection->invokeArgs($this, $pass);
}
?>