Re: [RFC] Undefined Variable Error Promotion

From: Date: Fri, 18 Feb 2022 12:31:56 +0000
Subject: Re: [RFC] Undefined Variable Error Promotion
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-117064@lists.php.net to get a copy of this message
On 18/02/2022 10:50, Rowan Tommins wrote:
Other than an optimised implementation, there's nothing particularly special about the ++ operator's handling of null, it behaves the same as any other arithmetic operator:
I would claim that the unary operators behave slightly different, if it were a case of cooerce to zero, the behaviour of null++ and null-- would be expected to be the same as operating on 0, but it's not. null++ is allowed, but null-- returns null, and its value afterwards is null. https://3v4l.org/Bnb2D
If anything, it's the fact that $a++ is NOT a special case that means it will be affected by this proposal.
It is intended to be affected by this proposal. -- Mark Randall

« previous php.internals (#117064) next »