Re: [RFC] Constant Scalar Expressions (with constants)
| From: | Derick Rethans | Date: | Thu, 07 Nov 2013 13:34:09 +0000 |
| Subject: | Re: [RFC] Constant Scalar Expressions (with constants) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70061@lists.php.net to get a copy of this message | ||
On Thu, 7 Nov 2013, Bob Weinand wrote:
> Hi!
>
> As you all know, Anthony Ferrara had withdrawn his RFC a few months ago, which was without
> support for constants in these expressions:
>
> const foo = 10;
> const bar = 10 * foo;
>
> The use of a constant in a declaration of a constant was not yet possible with his patch.
>
> That's what I changed.
>
> Enjoy reading the RFC at:
>
> https://wiki.php.net/rfc/const_scalar_exprs
https://github.com/bwoebi/php-src/compare/const_scalar_exprs#diff-4d0b93094aafe8cf519b4f0a3322f471L590
-#define IS_CALLABLE 10
+#define IS_CONSTANT_AST 10
+#define IS_CALLABLE 11
Can I please suggest that you do not change existing constant values?
You're using a macro to check for the constant type anyway, so you can
do the complex checking for constant types in there.
I'm also of the opinion that just " This can allow for writing far
easier to understand code, by allowing for far more expressive code." is
by far not enough of a justification for a syntax addition. Please
please try to be convincing by having good arguments, presenting
alternatives and cons.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine