RE: [PHP-DEV] [RFC] Constant Scalar Expressions
| From: | Patrick Schaaf | Date: | Wed, 14 Aug 2013 06:30:00 +0000 |
| Subject: | RE: [PHP-DEV] [RFC] Constant Scalar Expressions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68503@lists.php.net to get a copy of this message | ||
Would this allow using constants, too? Class constants?
const FOO = 1;
const BAR = self::FOO + 1;
const BAZ = self::FOO + 2;
const BARF = GLOBAL_BARF;
const IMPORT = otherclass::IMPORT; // with autoloading?
In my opinion these would start to make the feature useful.
Even more useful, but probably outside the scope of that RFC, would be
permitting arbitrary expressions in the initializers (const or property
defaults) that would be resolved at runtime, before the class is used for
the first time.
best regards
Patri