Re: [RFC] Path to Saner Increment/Decrement operators
| From: | Craig Francis | Date: | Wed, 18 Jan 2023 16:10:25 +0000 |
| Subject: | Re: [RFC] Path to Saner Increment/Decrement operators | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119320@lists.php.net to get a copy of this message | ||
On 18 Jan 2023, at 12:22, G. P. B. <george.banyard@gmail.com> wrote:
> [...]
> I appreciate being shown concrete cases about the useful ness of this operation.
> The reason I didn't go with adding support for decrementing alphanumeric
> strings is that it was unanimously rejected.
> However, if Rowan's suggestion of adding
> string_increment()/string_decrement() with more rigorous behaviour (that we
> can flesh out together) would be part of this proposal, would you be more
> inclined to accept deprecating ++ from performing this feature?
Hi George,
I don't have a vote at the moment (I think I need one more RFC to pass)... but you might be
able to convince me, I just like to know that breakages are really worth it, because my biggest
issue is trying to get developers to upgrade their PHP installs (a lot are still on 7.4).
I agree that some of the incrementing behaviour can be a bit weird, and I would be happy to see
those be deprecated/removed; but I worry that the A, B, ..., Z, AA, AB, etc is something that works
well today, and is likely to be tricky to find/replace with a new function in all existing code.
At the moment I'd prefer Option 2 or 3, with the focus being on "tiding up the behaviour
of the alphanumeric string to make it stricter and less error-prone."
Craig