Re: [RFC] Path to Saner Increment/Decrement operators
| From: | Rowan Tommins | Date: | Wed, 18 Jan 2023 16:34:04 +0000 |
| Subject: | Re: [RFC] Path to Saner Increment/Decrement operators | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119321@lists.php.net to get a copy of this message | ||
On 18 January 2023 15:32:28 GMT, Derick Rethans <derick@php.net> wrote:
>> The goal of this RFC is to reduce language complexity by making $v++
>> behave like $v += 1 and $v-- behave like $v -= 1;
>
>If that is the goal, then I would agree with this RFC.
>
>However, changing the PERL string increment feature does not IMO fit
>into that goal
I agree, *changing* its behaviour does not achieve that goal; only removing the behaviour (with an
appropriate deprecation period and upgrade path) achieves the goal.
(For completeness, the only other way to achieve the goal would be to add support for string
increments to the += operator, and presumably also the + operator to avoid a different
inconsistency. That is, make 'a' + 5 === 'f'. I don't think that's
even worth considering, but it's the only other way to achieve consistency.)
Regards,
--
Rowan Tommins
[IMSoP]