Re: Draft RFC: foreach iteration of keys without values
| From: | Dik Takken | Date: | Thu, 03 Sep 2020 08:19:06 +0000 |
| Subject: | Re: Draft RFC: foreach iteration of keys without values | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111805@lists.php.net to get a copy of this message | ||
On 03-09-2020 09:38, Brent Roose wrote:
> Hi all
>
> I want to point out the use-case when you're using CS tools, static analysers and IDEs:
> they report unused variables as errors. There are ways around those errors, but it's more
> convenient if there's language support. I'd say that conceptually it's also more
> correct: if you're not using a variable, it shouldn't be there.
Exactly this.
The intent of a particular language construct does not only need to be
clear to human readers but also to machines. More explicit intent leads
to stronger static code analysis tools, which helps us catch more bugs
earlier.
Regards,
Dik Takken