Re: calling static methods of variable class names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux