On Fri, Jul 10, 2009 at 4:25 PM, Madbreaks wrote:
>
>
> 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.
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 evi
Jack Bates wrote:
> How do I access a static variable when I do not know the name of the
> class until runtime?
>
> I have the following example PHP:
>
> ket% cat test.php
>
> class Test
> {
> public static
> $STEPS = array(
> 'foo',
> 'bar');
> }
>
> $className = 'Test';
>
> va
Try this, maybe:
($className)::$STEPS
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How do I access a static variable when I do not know the name of the
class until runtime?
I have the following example PHP:
ket% cat test.php
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
5 matches
Mail list logo