[RFC] Constant Scalar Expressions (re-opening)

php.internals

Andrew Faulds

12 years ago
Greetings, Unfortunately, as you will no doubt well be aware, Anthony Ferrara, aka ircmaxell, decided to cease contributing to PHP. This is not a matter I wish to discuss here, but it is relevant to the subject of this email. Because he left, he withdrew all the RFCs he authored. Since I like this RFC of his, I have decided to copy the content of it and the patch to new locations, and re-open it. The RFC, so far as I can tell, looks fairly complete as it stands. I am deciding to champion it because I think that such static expressions are useful for code readability. The intent of, for example, const TIME_PERIOD = 7 * 24 * 60 * 60; is much clearer than const TIME_PERIOD = 604800;, and there are other examples of how this could be useful. I have read through the previous mailing list discussion, and while I will admit that, yes, this RFC does not allow some possibilities that would be nice (like using constants in such expressions, for example), I think it is still quite useful and an improvement on the status quo. So far as I can tell, there are no remaining unanswered questions or unresolved issues with this, so if that is the case I would like to move this towards a vote fairly soon. The new RFC is here: https://wiki.php.net/rfc/const_scalar_expressions2 It is identical in content aside from a changed header and links. If this could be added to the list of RFCs Under Discussion that'd be great. Thank you for your time.
-- Andrea Faulds http://ajf.me/

Clint Priest

12 years ago
On 10/17/2013 7:05 PM, Andrea Faulds wrote:
> I have read through the previous mailing list discussion, and while I > will admit that, yes, this RFC does not allow some possibilities that > would be nice (like using constants in such expressions, for example), > I think it is still quite useful and an improvement on the status quo. >
I agree, even without constants support it would be a big plus. I'm not sure everyone agrees that it should move forward without constants support though (and I would personally prefer them in as well, but not at the expense of pushing this feature out a year).

Andrew Faulds

12 years ago
Evening all, I am now bringing it to a vote as the discussion period of 2 weeks has finished and I have heard no exceptions. Please vote here: https://wiki.php.net/rfc/const_scalar_expressions2#vote Thanks!
-- Andrea Faulds http://ajf.me/

Andrew Faulds

12 years ago
On 01/11/13 19:02, Andrea Faulds wrote:
> Evening all, > > I am now bringing it to a vote as the discussion period of 2 weeks has > finished and I have heard no exceptions. > > Please vote here: https://wiki.php.net/rfc/const_scalar_expressions2#vote > > Thanks! >
Well, that was quick! bwoebi on IRC has told me to cancel the vote because he has just finished his patch to support constants in such expressions. For that reason I'll cancel the vote for now. Thanks.
-- Andrea Faulds http://ajf.me/