Posted by David Grant on 11/22/05 15:44
Ahmed,
call_user_func(array($className, 'doSomething'));
Cheers,
David Grant
Ahmed Saad wrote:
> hi all,
>
> how can i call static methods of a class whose name is variable.. something like
> <? $className::doSomething(); // throws a parser error ?>
> I can do this with reflection by creating a ReflectionMethod object
> then invoke()ing it, but is there a better way?
> Thanks
>
> -ahmed
[Back to original message]
|