Hi all!
Does anyone know a methode to give a function the rest of the func_get_args from the current function? Wired? Here we go:
class a {
var a1,a2;
function a()
{
$arr=func_get_args();
$this->a1=array_shift($arr);
$this->a2=array_shift($arr);
return $arr; /* giving rest back to subclass-constructor */
}
}
class b extends a {
var b1,b2;
function b()
{
/* 1st: let constructor make the thing */
$arr=$this->a( /* here inserting the var arguments given to b()? Howto??? */ );
/* Now, THIS class may have additional parameters */
$this->b1=array_shift($arr);
$this->b2=array_shift($arr);
return ($arr);
}
}
The point is: I don't like to use an array as function argument, but a simple parameter list. Of course, arrays may be a solution - in case of emergency.
Also, i don't like to build the args to a string and then use it in an eval'd constructor call. Dunno if there may be side effects. And is producing probably overhead.
Anyone an idea?
Thanks!