Re: runtime access to static variable
| From: | Madbreaks | Date: | Fri, 10 Jul 2009 19:25:15 +0000 |
| Subject: | Re: runtime access to static variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295161@lists.php.net to get a copy of this message | ||
Jack Bates-2 wrote:
>
> How do I access a static variable when I do not know the name of the
> class until runtime?
>
Why not just:
eval('$staticVal = '.get_class($myClass).'::staticVarName;');
...now the value is in $staticVal.
Or am I missing something here? No need to tell me eval is evil ;)
--
View this message in context: http://www.nabble.com/runtime-access-to-static-variable-tp21041719p24433169.html
Sent from the PHP - General mailing list archive at Nabble.com.