Re: Allow null variables to be decremented
| From: | Mark Randall | Date: | Sat, 15 Feb 2020 18:21:56 +0000 |
| Subject: | Re: Allow null variables to be decremented | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108604@lists.php.net to get a copy of this message | ||
On 15/02/2020 17:44, Rowan Tommins wrote:
There is currently an odd inconsistency when using the decrement operator on a null variable:I'm not so sure... That incrementing a null works at all is a painful part of the language spec that I would argue needs flushing down the toilet, rather than further reinforcing. I recon the required precursor to doing so is erroring on undefined variables, which I suspect accounts for about 99% of increment-on-nulls. The majority are in favour (56%) but not the supermajority necessary - Athough there's an argument to be made that a supermajority may exist in a straight up or down vote rather than a 3-way (https://wiki.php.net/rfc/engine_warnings). So on one hand, consistency is good. On the other hand, being consistently bad is still being bad. -- Mark Randall marandall@php.net