Re: Re: class constants in RC1 - why not __self:: then?
| From: | Luna Kid | Date: | Sun, 28 Mar 2004 17:21:29 +0000 |
| Subject: | Re: Re: class constants in RC1 - why not __self:: then? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8810@lists.php.net to get a copy of this message | ||
> > This way (writing __thisclass::MYCONST instead of MyParticularClassName::CONST
> > we could freely decide to favor clean style, or performance, depending on the specific
> > situation.
>
> No need for that we have 'self':
> php -r 'class c { const c="Hello\n"; static function f() { return self::c; }}
> echo c::f();'
Yoohoo!!! Wonderful, thanks! :)
(Dunno how I could miss this, but who cares now that PHP is PERFECT... :) )
Cheers,
Lunatic