Re: access a static variable of a class
| From: | Esteban Fernández | Date: | Mon, 09 Jun 2003 20:07:53 +0000 |
| Subject: | Re: access a static variable of a class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150797@lists.php.net to get a copy of this message | ||
Do you try with the "global" sentence ?
.
.
.
global $conf;
$var = 'foo';
echo $var::$conf ;
?>
EF.
On Mon, 09 Jun 2003 18:34:33 -0200
aberindei@ipacri.ro (Aberindei) wrote:
> Hello,
>
> One line to say this is my first post here, I thought about posting in
> php-general, but ZE2 is in development, so...
>
> I want to access a static variable of a class, but I CANNOT use
> directly the class name, so class name is in a variable.
>
> To be clear:
>
> <?PHP
>
> class foo {
> static $conf = 'configuration variable';
> }
>
> $var = 'foo';
>
> echo $var::$conf ;
>
> ?>
>
> this produces a parsing error...
>
> How could I do ?
>
> Thanks
>