Re: [RFC] Number Format Separator
| From: | Christoph Becker | Date: | Tue, 12 Jan 2016 13:49:03 +0000 |
| Subject: | Re: [RFC] Number Format Separator | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-90545@lists.php.net to get a copy of this message | ||
Thomas Punt wrote:
>> I'd like to propose for the inclusion of a digit separator in PHP. This will
>> help to promote the readability of numerical literals in code by enabling for
>> the underscore character to be used in between digits.
>>
>> RFC: https://wiki.php.net/rfc/number_format_separator
>> PR: https://github.com/php/php-src/pull/1699
>
> Just bringing this back up to the top because of the recent influx in internals
> activity. I'm hoping to put this to vote tomorrow, so if anyone has any
> questions or problems with this RFC, then please let me know!
Thanks for pushing that improvement forward, Tom.
AIUI, digit separators are stripped during lexing, so
echo 1_000;
will print
1000
I think it is important to explicitly note that in the RFC.
With regard to "stringy numerics": besides the potential BC break, IMHO
there is no need to support digit separators for string literals at all,
because that could easily be provided by a userland function. Maybe
it's worth pointing that out in the RFC.
--
Christoph M. Becker