On Mon, 2002-06-10 at 22:37, Leendert Brouwer wrote:
> I have just started experimenting with the Zend 2 engine, and totally love
> the new OO features. I'm not sure whether this has been discussed or not (I
> couldn't find it in the archives, anyway), but I ran into a few things:
> Constant class members seem to be private by default. I cannot access them
> by doing
> $instance->CONSTNAME
> Is this expected behaviour? I'd expect constants to be public by default,
> just like regular variables, unless specified otherwise (when I try doing:
> private const FOO = "bar"; I get a parse error). Same for private static.
> Is this all going to change? It seems a bit illogical now.
> Thanks

Constants belong to the class, not the instance.  Try Class::CONSTNAME
instead.

 - Stig

-- 
Stig Sæther Bakken, Fast Search & Transfer ASA, Trondheim, Norway
http://pear.php.net/wishlist.php/ssb


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to