Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111803 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37440 invoked from network); 3 Sep 2020 08:33:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Sep 2020 08:33:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 50E7C180088 for ; Thu, 3 Sep 2020 00:38:53 -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,HTML_MESSAGE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from srv015.mail.ichtushosting.com (srv015.mail.ichtushosting.com [159.69.182.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 3 Sep 2020 00:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stitcher.io ; s=default; h=Message-Id:In-Reply-To:To:References:Date:Subject:Mime-Version :Content-Type:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=v1e87XqxQRV/k8mnI1IwKB18ZSh1Kr+SYHlVlr+54JY=; b=hRAO73jFJEX27PeeFgEf2cy9Oo Uvw0aujJTRv/r4yNDZeckVsnuz5B0FEFRCMyJQ4LDlPDYYZ5C4iwxTJCeAZ9y9383J86q/JZSnLuV 7Gt6KgIrERWqhgjQj1UbRthf2Zr1Lo7qzVZaPt3vWlFoLRhK88ivswkpcAqNXHSUazJiKT5BblOGy FmEWhL3Q9+FnSMv/Tx+k1Yu5flsuriiUEHDtwt2lxWpoBfLWspJHXVBmh/hfDxCIv7211e+pYQUGd g/nj0G7/FxC+CEsl6n0Pv2NKpxnSTeC1nHu/A5RUgiubfLFAcDbcpFrtmdqOqXMJJpwjkQ9ypVd0Y lHbYA96g==; Received: from srv021.web.ichtushosting.com ([78.47.76.72]) by srv015.mail.ichtushosting.com stage1 with esmtp (Exim MailCleaner) id 1kDjpY-00042D-DX for from ; Thu, 03 Sep 2020 09:38:48 +0200 Received: from ptr-fq9pjpgp06mqjnu09py.18120a2.ip6.access.telenet.be (ptr-fq9pjpgp06mqjnu09py.18120a2.ip6.access.telenet.be [IPv6:2a02:1812:c3c:3a00:2966:cccf:9854:7b36]) (Authenticated sender: brendt@stitcher.io) by srv021.web.ichtushosting.com (Postfix) with ESMTPSA id 3D41720F24 for ; Thu, 3 Sep 2020 09:38:46 +0200 (CEST) X-MailCleaner-return_path: brendt@stitcher.io X-MailCleaner-sender_address: brendt@stitcher.io X-MailCleaner-recipients: internals@lists.php.net Content-Type: multipart/alternative; boundary="Apple-Mail=_A7CA3C61-A38A-4002-BA07-F47102238D15" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Thu, 3 Sep 2020 09:38:45 +0200 References: <89FF9360-609A-439F-BDBE-B3B4C141E00F@newclarity.net> <95eddd89-9915-14fc-7649-9de0e8dd349d@gmail.com> <306f190e-efd8-0db8-a9c3-aff3c90aa1c6@gmail.com> To: PHP internals In-Reply-To: <306f190e-efd8-0db8-a9c3-aff3c90aa1c6@gmail.com> Message-ID: <53FF7328-F05C-496E-8F57-5A81B899CED1@stitcher.io> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-MailCleaner-TrustedIPs: Ok Subject: Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values From: brendt@stitcher.io (Brent Roose) --Apple-Mail=_A7CA3C61-A38A-4002-BA07-F47102238D15 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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. As some of you have shown, there are ways achieve the same result = without adding new syntax. Just like we didn't need short closures and = keep using the normal closure syntax, like we could write if statements = and didn't need the nullsafe operator, like we didn't need named = arguments or constructor property promotion. I think the past years of = PHP devlopment have shown that the majority likes convenient langague = syntax and constructs, not because it's absolutely necessary, but = because it's just a little more clean, a little less verbose, a bit more = convenient. PHP has been maturing over the last years, which means there's room, and = need, for things that aren't strictly necessary. Kind regards Brent > On 3 Sep 2020, at 09:18, Stanislav Malyshev = wrote: >=20 > Hi! >=20 >> If it adds a micro-optimization, great, but allowing a developer to >> explicitly signal intent is the primary argument for adding void. >> IMO. >=20 > You can signal intent by using $_ or $dummy or whatever. You don't = need > new language construct each time for each way of using or not using a > variable. >=20 > --=20 > Stas Malyshev > smalyshev@gmail.com >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >=20 --Apple-Mail=_A7CA3C61-A38A-4002-BA07-F47102238D15--