Re: [RFC] Reclassifying engine warnings

From: Date: Wed, 28 Aug 2019 20:28:01 +0000
Subject: Re: [RFC] Reclassifying engine warnings
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-106772@lists.php.net to get a copy of this message
On 28/08/2019 20:48, Stanislav Malyshev wrote:
Sure, that works. But I don't see any way this clunker is better than $counts[$key]++
Because it's explicit, and incrementing null is mathematically unintuitive. After all, null does not exist anywhere in the set of natural numbers, so Roman etymology aside, adding 1 to it shouldn't magic it into a completely different type without some explicit cast. ?? Let's you go "I know this index may not exist, if it doesn't, use 0 instead". No funky type coercions that are in no way apparent from looking at the code. To use the analogy someone posted elsewhere... the training wheels are coming off. Time to be responsible and type those few extra characters to be clear on your intent. -- Mark Randall

« previous php.internals (#106772) next »