Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109685 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26352 invoked from network); 16 Apr 2020 15:32:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Apr 2020 15:32:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2CD731804D3 for ; Thu, 16 Apr 2020 07:02:38 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.web.de (mout.web.de [212.227.15.3]) (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, 16 Apr 2020 07:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1587045752; bh=Ebr5Gqy1w9FOw1EeszDJnwvidNMq82EGTRWGl3UEvPk=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=IB+HxYJjkfQWcDLvnodwczTw1BLKW6VIUfRE+Z3H/hw2BaupTrxwK+iuv2/AjmySy 6e7Z3Tq//eSHJMmW3wNkf/SWMveAFNLKfNismSZz/05hPqm54eCygSu1inWZuUuQYB 41wim5qra2lBlPvJ83dLkEW9oV6p7EoAGUFQHp9c= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.21] ([88.66.220.134]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M8zhl-1jX1Zl1ukn-00CO5q for ; Thu, 16 Apr 2020 16:02:32 +0200 To: internals@lists.php.net References: <2b8e5da5-2f21-57a2-7e7d-243c686cc69d@web.de> Message-ID: <4fbdee72-e6b1-3ba3-4846-4a62e7d01c59@web.de> Date: Thu, 16 Apr 2020 16:02:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Antivirus: Avast (VPS 200415-0, 15.04.2020), Outbound message X-Antivirus-Status: Clean X-Provags-ID: V03:K1:frjDx9GX3tTEeUKWhq8YukUOFtLAzRXBOv4qMyOOhJdd9uz1lJH dLWRjWhdJHDSRy5NHrYwyAD7Eytc6xniPHrVhZSD9ySJK193bsod6QZs9/fTni9rRNdu8gu 0I2R/OMTUErRmUlbueC2zBDS8aJihhHafJasVng6AHJGA5LRvMWX0kOvp2UTyIetY+n/mV+ 2Poutipcve6hn/MCh4IpQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:mXdI+HImqGo=:LPWlE39Aon60HnZ6l3Aavb CMb1ybWOWYejXoCdmMVmg+K8SthPU7N4wzzpNNV+Jzo505rfwll9Bpw6hRc1EVZxjJb9tLAgf e2wQWIpqhHE5wbroIUQAPhokA2jowYEF3gtSbuIj6MH8vVTWOE+RWI3rOnt6r+8AhuPJL+qY9 Cf3gUcuW6OGbJ1wjrBP1kXK2x9YmPs+HSMAxOO1f1Q5UAkOMlRanz9NI8sZ1vHXvBl5/3UQCB HxC1/qe6XMTja2vE0ILScw48T/EZKaEicEgfjxDLtiuGNOMBo6gPBfmmHwEgV6gGLfEaPjvgF lVQdpqRJBf/G9FYuuBA3v/SM3ffBrrKgFpX6FHCsAziMNtjR2UPYhbKdU5NcWA6NlapwMUSf5 3f3Kh0pspUTp9yGdsmoAsZEA98jGFEgNl4pE2vQ8xGtHIW8r35z3fPKetR+CPn3R1ufg5dzz0 fY2Nwh4FY37aIriaMJy0eCSInRWA8l1rmFAgZqmS3uNZd/1idEn/oGPqwkl0cqm3L2PLwA5jj 394wFV8Ugtc9b9lm2blM8IODvkvcF1pL0eSIa04qh5FgYiL/BuAOLmZlemeSiftyaovTw37PN 5kqO8yh9kZjYjfeTkZeW9NiGywZ8OhtK7m1xcDhXIGg1PB9S2KC5dk0r6FvEYbspfdW2ByORv Zu8jYQgajIZCHKR6wL+VuTOyfCLn1HHGelPfXT4PhlBj9tqnd8U/YBmwUGpr9yJm/gmrztt4j 759OYO5FagAt+bOgY34bn2czJ86Tnefv10nR0w4JtN1Vt+TpZeWqBDFUbgx7LssF9Cq1kTjUb 4p3Bs6qe6nqq+kxO2fqH7d7HUohvYIAneI/QiCPhAWeabgeG9LFEn7WI7qzqa51jYz1CyUxO+ Q/fHAg4d96RKo0irL6c+Cxf/kpUwYlQMx3voICN1cLY2Yb6nYcp78a5F40ep2h7F1dt1GXgfN dSMvBBuFQG3lYEkcgU3/Ygpk96Zjx0H/3sVZ+7VsogZYmhZJErhjurTCrnmKow0Yg8gFujC3w jNVd9dAgLTIYFODBhXx9iCh5QUpAxssewGnkUX+CWuuyJNtKeU8aNFzZs0uvCjTGiiWKSfLJB jzsu16wS9Bwj4pzuF6iKhO6FBfEt8hWtm4pk0zILcSNRLa3ZRqGbN4x+JH+oBWDNoM7b5Kk0L y13408R2QM0DzWCzt9wXIHI/hfsD3mW1i9FH/JusxGGXO5aBSBbHMg2+8fd8wMotKXA6LZp9v 12dH4P4AE01gdGxBP Subject: Re: [PHP-DEV] Type hints in array destructuring expressions From: enno.woortmann@web.de (Enno Woortmann) Hi, > - It has been requested several times on this list to stop using the > wording "type hint" and instead write "type declaration" ;) I've updated the RFC to use the "type declaration" wording, thanks for the hint :) > - When I see this example in the RFC: > ``` > $years =3D [["now", 2020], ["future", 2021]]; > foreach ($years as [string $description, int $year]) { > ``` > I immediately think of a similar: > ``` > $years =3D ["now" =3D> 2020, "future" =3D> 2021]; > foreach ($years as string $description =3D> int $year) { > ``` > or: > ``` > $foos =3D [new Foo("one"), new Foo("two")]; > foreach ($foos as Foo $foo) { > ``` As the RFC tackles array destructuring expressions and not foreach loops (which is just an option to use array destructuring there) I think this is out of scope for the RFC. I've added it to the future scope section though as I think it would align with the current proposal. Thanks for the input! Cheers, Enno