i suggest the passthru functionality to pass parameter to other method
without typing all parameters,like call_user_func_array.

foo(passthru()); = call_user_func_array('foo', func_get_args());


// case 1:

function a($a,$b,$c)
{
//...
}

function aa()
{
a(passthru()); // like call_user_func_array('a', func_get_args());
someOthers();
}

aa('foo','bar','baz');



//case 2:

class base
{
protected function insert(BaseType $object,$a,$b,$c)
{
 }
}

class son extends base
{
public function insert(SonType $object) //type hinting differs from base
{
parent::insert(passthru()); // like call_user_func_array(array('parent',
'insert'), func_get_args());
}
}

$son = new son();
$sonType = new SonType();
$son->insert($sonType,'foo','bar','baz');

-- 
Mathias Grimm

Sun Certified Java Programmer 6.0 #SUN604760
Zend Certified Engineer #ZEND006756

http://mathiasgrimm.com.br
http://phpempregos.com.br

Reply via email to