On Wed, May 29, 2019 at 2:49 AM Côme Chilliet <c...@opensides.be> wrote:

> What bugs me with this RFC is that it seems to be mainly intended
> for grouping digits by 3, which from what I understand is cultural.

While it is expected that grouping decimal literals by 3 will be a
frequent use case, the RFC does not enforce an arbitrary group size.
Not only would doing so add complexity, but it would also prevent
some of the use cases mentioned in the RFC. For example, if you're
working with financial quantities stored as cents, it can be useful
to group the dollar amount by 3 and the cents by 2:

```php
$amount = 100_500_00; // represents $100,500.00
```

The RFC also contains examples of grouping hex and binary literals by
2, 4, or 8 digits.

Not placing restrictions on the size of digit groups enables
programmers to choose the grouping that best reflects their intent.
It's also consistent with the other languages that support this
feature.

> I will not vote no on the RFC, most likely I won’t vote. But I
> think I will not use this in my code.

That's fine. Not everyone has a use case for this feature, but it can
be very helpful for those that do.

Best regards,
Theodore
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to