Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111806 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45099 invoked from network); 3 Sep 2020 09:20:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Sep 2020 09:20:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8F772180502 for ; Thu, 3 Sep 2020 01:25:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 3 Sep 2020 01:25:20 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id a15so2620516ljk.2 for ; Thu, 03 Sep 2020 01:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RKbVHknLmjAiZALdaJcvRyKF8dOiqCTP55dmv3CAvZ0=; b=NI6RBLMfmzq4s0hRzHC+6RiFCXsfI2QGEs55ZOBUD1iGIrqbRmAt+VAcKC2NtXK+vf 70NvK++qPT8s6gIzxlkgrpsK8uLoQdzclVzoiBJbqgH7szxgQR4cq84Of7RP7izemqtJ LLvYyMkd7iin9886EHX6uS2MmIZiXzCXld4jjFToZt/PegGoCUeThuYsVOP/CQHVxsPF MsVBEGm1g9bLTAjy6p6nVYPrPbCFlpI6OJif+UrUymBD1wv2YRPfMSg84pDAy4a76MWP IzMHSZ4lN+bs0D1o7rZ7UKFKSTIPptEDs5XxROqhx3QGIiDUVKoeoT9yTjyHobvdJrb1 fqSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RKbVHknLmjAiZALdaJcvRyKF8dOiqCTP55dmv3CAvZ0=; b=Va1x9+8TIerfYrSQt/JAM3bxETEY00FtpSCbaRPxRzlG7FZbgR6RhtNb9r7EOhS8NG JKIyqu9ov/UKGalFoEIJd9uCo/4OpA4+7HL6W4MKPzZu4N4vE5Kj8d6/1JHb2AymHgeF rCgehe/momO7RJgUEQvaM9pmrPIPwsFsGZoBPviB00IWcZddfWzFKeiLkdFHbWYP3sxG sVaJO6QJ3ciSjpMX3KUaJHcpXklgyBqocyi+OeEM0mh+sOB+qyOVBGKbnf8/txISSUXQ 6spmw6Wlyz+6ZYCVR/Oz335mMsmUwNbctLdKvlBVljcmvhBUx+Vx6Mg+f0qJKl1bBz9d kR+g== X-Gm-Message-State: AOAM531aaOaMSKvBI7bEfNBtea9nU5kBLxK9CXxeU0s3IvWsCM1uaf3A Pld1l7dFFf0o7Q8NRLVvz8gkR5oaFLYLqU7vzR0= X-Google-Smtp-Source: ABdhPJxhbIkuobCsJSQL632il3tW+gwvPx7vlz6xsGFYKAehe6kZPZrI+FtXOaRoaScb6P98QVUKBTHBEqZK45rWOx0= X-Received: by 2002:a2e:b531:: with SMTP id z17mr740557ljm.30.1599121516940; Thu, 03 Sep 2020 01:25:16 -0700 (PDT) MIME-Version: 1.0 References: <89FF9360-609A-439F-BDBE-B3B4C141E00F@newclarity.net> <95eddd89-9915-14fc-7649-9de0e8dd349d@gmail.com> <306f190e-efd8-0db8-a9c3-aff3c90aa1c6@gmail.com> <53FF7328-F05C-496E-8F57-5A81B899CED1@stitcher.io> In-Reply-To: Date: Thu, 3 Sep 2020 10:25:01 +0200 Message-ID: To: Dik Takken Cc: Brent Roose , PHP internals Content-Type: multipart/alternative; boundary="000000000000f8516b05ae647d06" Subject: Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values From: nikita.ppv@gmail.com (Nikita Popov) --000000000000f8516b05ae647d06 Content-Type: text/plain; charset="UTF-8" On Thu, Sep 3, 2020 at 10:19 AM Dik Takken wrote: > 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 > Static analysis tools don't need a language feature to support this. They can recognize the $_ pattern and not emit an unused variable warning for it. I'd suggest submitting a feature request. Nikita --000000000000f8516b05ae647d06--