Re: Constant and expression ?
| From: | Christian Schneider | Date: | Wed, 19 May 2010 11:49:54 +0000 |
| Subject: | Re: Constant and expression ? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48347@lists.php.net to get a copy of this message | ||
fqqdk wrote:
> How about extending the usage of the 'final' keyword to support a java-like
> syntax?
>
> class Foo {
> private static final $bar = 'ex' . 'pression';
In my book "final" in Java gets an award for sickest abuse of a keyword.
So no, I don't consider this an option. Simply use a class variable (or
define()) if you need to store some runtime calculated value.
"But <insert other language> can do this" alone is not sufficient as a
reason to bloat PHP IMHO.
- Chris