On Tue, Aug 23, 2022 at 6:27 PM Daniel Wolfe <d...@the-wolfeden.com> wrote:

>
> If we do go down the operator route, however, what tokens should be
> chosen? `%%` makes since for floor modulo, but `//` is already used for
> comments.
>

Yeah I appreciate it is tricky, because // is pretty much the only
obviously sensible syntax for such an operator and it's unavailable.
I don't know what the objections were around an operator verus intdiv way
back then - maybe that was one of them, maybe people just didn't feel it's
something you do often enough to warrant an operator. Both valid objections
and likely to come up again if they came up before.

*shrug* nothing inherently wrong with your proposed functions being
functions, either, I can just see floor_div and floor_mod getting mixed up
with fdiv and fmod but maybe I'm overthinking it, maybe it wouldn't really
be an issue. Maybe there's alternative names you could give them though
again I suspect the ones you've chosen are the most obviously sensible to
describe what they do.

See what other people think - personally, I support the idea of having the
functionality to perform these operations, one way or another, supported in
the core, just because I think they are common enough scalar operations
that it's worth them being directly supported rather than being a third
party package.


>
> * <https://wiki.php.net/rfc/intdiv>
>
>
>

Reply via email to