Re: Constant Scope PHP5
| From: | Zeev Suraski | Date: | Sat, 23 Aug 2003 18:20:11 +0000 |
| Subject: | Re: Constant Scope PHP5 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4146@lists.php.net to get a copy of this message | ||
Yes, there appears to be some inconsistency here. We'll look into it.
Zeev
At 21:14 23/08/2003, Brad Bulger wrote:
hmm. but you can reference class constants without class/self:: when creating futher constants ('const bla = foo << 1;') and this works, too: <?php class foo {const bar = 3; function bla($x) { if ($x === bar) print "yes it's bar\n"; else print "no it's not\n"; }} $x = new foo; $x->bla(4); $x->bla(3); ?>Zeev Suraski wrote:Output: no it's not yes it's barAt 14:35 22/08/2003, Arjen Brouwer wrote:-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpShould'nt this work? Currently it reports an error about a undefined constant. <? class Test {Should be var $bar = Test::FOO (or self::FOO, even though it appears not to work right now) - there's no implicit class/object dereference of any kind in PHP. Zeevconst FOO = 100; var $bar = FOO;