Re: [PHP-DEV] Constant Scope PHP5

2003-08-23 Thread Curt Zirzow
* Thus wrote Zeev Suraski ([EMAIL PROTECTED]): > At 20:40 23/08/2003, l0t3k wrote: > >Zeev, > > speaking of const, i have a feature request. why not accept "const" in > >the global context and create a compile-time global constant ? > >e.g. > > > >const FOO = 1 ; > >const BAR = 2; > > > >

Re: [PHP-DEV] Constant Scope PHP5

2003-08-23 Thread Zeev Suraski
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: bla(4); $x->bla(3); ?> >> Output: >> no

Re: [PHP-DEV] Constant Scope PHP5

2003-08-23 Thread Zeev Suraski
At 20:40 23/08/2003, l0t3k wrote: Zeev, speaking of const, i have a feature request. why not accept "const" in the global context and create a compile-time global constant ? e.g. const FOO = 1 ; const BAR = 2; class Barbara { const Barbara::BUSH = FOO; }; i'd much prefer

Re: [PHP-DEV] Constant Scope PHP5

2003-08-23 Thread Brad Bulger
hmm. but you can reference class constants without class/self:: when creating futher constants ('const bla = foo << 1;') and this works, too: bla(4); $x->bla(3); ?> >> Output: >> no it's not >> yes it's bar Zeev Suraski wrote: At 14:35 22/08/2003, Arjen Brouwer wrote: Should'nt this work? Curre

Re: [PHP-DEV] Constant Scope PHP5

2003-08-23 Thread l0t3k
Zeev, speaking of const, i have a feature request. why not accept "const" in the global context and create a compile-time global constant ? e.g. const FOO = 1 ; const BAR = 2; class Barbara { const Barbara::BUSH = FOO; }; i'd much prefer this as an alternative to the r

Re: [PHP-DEV] Constant Scope PHP5

2003-08-23 Thread Zeev Suraski
At 07:03 23/08/2003, DvDmanDT wrote: Wait a sec... When did const become a keyword? In PHP 5.0. And since when can you initialize variables from outside a constructor/function? Since PHP 3.0 :) Zeev -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net

Re: [PHP-DEV] Constant Scope PHP5

2003-08-22 Thread DvDmanDT
Wait a sec... When did const become a keyword? And since when can you initialize variables from outside a constructor/function? Sorry to bother.. -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] "Zeev Suraski" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > At 14:35

Re: [PHP-DEV] Constant Scope PHP5

2003-08-22 Thread Zeev Suraski
At 14:35 22/08/2003, Arjen Brouwer wrote: Should'nt this work? Currently it reports an error about a undefined constant. 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. Zeev -- PHP In

[PHP-DEV] Constant Scope PHP5

2003-08-22 Thread Arjen Brouwer
Should'nt this work? Currently it reports an error about a undefined constant. bar; ?> Ciao, Arjen