On Thu, Apr 25, 2019 at 6:07 PM Theodore Brown <theodor...@outlook.com>
wrote:

> Is there any chance the Number Format Separator RFC [1] could be revived
> for PHP 7.4? I looked at the discussion from a few years ago and it's not
> clear why many people originally voted against it.
>
> JavaScript and Python have both gotten this feature recently and it's
> something I really miss in PHP when declaring/reading large numbers.
>
> Maybe it would help to simplify how the restrictions are described in the
> RFC. As I understand it, the only restriction is that each underscore in a
> numeric literal must be between two digits. Perhaps the way the RFC
> described this syntax made it seem more complex than it is.
>
> Best regards,
>
> Theodore Brown
>
> [1]: https://wiki.php.net/rfc/number_format_separator


Subsequent conversation occurred on the voting thread [1], which wasn't
included by reference in the RFP itself.

The only dissent I saw in that thread came from Pascal Martin, speaking for
AFUP, who wrote [2]:
> it would be harder to search in code, as there would be more than
> one way to write a number. Basically, it would break grep/find.
> Splitting numbers so they are more readable is kind of a presentation
> matter and, as such, could be done by an editor/IDE when displaying
> code, without having to modify the code by hand

Related: the RFC author Tom Punt also detailed the implementation, but
didn't incorporate that by reference into the RFC [3]. Worth the read.

With Tom's blessing, I'd support re-visiting this feature. It's useful, IMO.

[1]: https://marc.info/?l=php-internals&m=145271098232484&w=2
[2]: https://marc.info/?l=php-internals&m=145320709922246&w=2
[3]: https://phpinternals.net/articles/implementing_a_digit_separator

Reply via email to