Re: Constant Scope PHP5

From: Date: Sat, 23 Aug 2003 22:14:02 +0000
Subject: Re: Constant Scope PHP5
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-4154@lists.php.net to get a copy of this message
* Thus wrote Zeev Suraski (zeev@zend.com): > 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 this as an alternative to the runtime define(). > > It's going to be runtime either way, because you could do if (...) { const > FOO = 1; } else {const FOO = 2 }. Not sure if we want it as syntactic > sugar for define() or not. This would be nice! Id like to add perhaps, but not sure how hard it would be, to make this constant (aliased define) unchangeable through out the life time of the script. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.internals (#4154) next »