hello!
I have a class method that takes a variable number of parameters and
correctly deals with them with func_get_args, etc ...
i.e.
class ABC
{
public function MooSaysTheCow()
{
foreach (func_get_args( ) as $arg_name => $arg_value)
{
...
}
}
}
now, the problem is: i want to override this class and this method, have
that overriding method call the base class and then do something else. The
problem is that I don't know how to pass the parameters along.
class DEF
{
public function MooSaysTheCow()
{
parent::MooSays TheCow( WHAT DO I PUT HERE ????? );
echo "Overridden version with new exciting features!";
}
}
Any ideas?
the best i've thought of so far is terribly yucky, and not flexible to
arbitrary numbers of parameters .... blech.
class DEF
{
public function MooSaysTheCow()
{
switch (func_get_num_a rgs())
{
case 1:
parent::MooSays TheCow(func_get _arg(0));
break;
case 2:
parent::MooSays TheCow(func_get _arg(0), func_get_arg(1) );
break;
etc ....
...
..
Comment