Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105097 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59913 invoked from network); 5 Apr 2019 11:45:32 -0000 Received: from unknown (HELO poczta.brzuchalski.com) (188.165.245.118) by pb1.pair.com with SMTP; 5 Apr 2019 11:45:32 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id C715A2984239 for ; Fri, 5 Apr 2019 10:41:22 +0200 (CEST) Received: from poczta.brzuchalski.com ([127.0.0.1]) by localhost (poczta.brzuchalski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yx5ZGj3R94Xz for ; Fri, 5 Apr 2019 10:41:19 +0200 (CEST) Received: from mail-lj1-f173.google.com (unknown [209.85.208.173]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id 491E32984236 for ; Fri, 5 Apr 2019 10:41:19 +0200 (CEST) Received: by mail-lj1-f173.google.com with SMTP id h21so4480489ljk.13 for ; Fri, 05 Apr 2019 01:41:19 -0700 (PDT) X-Gm-Message-State: APjAAAUTq+wTqvYt9H7+fn38CvWZDL8MIwRBBajkHgHrbt13FbTdUDFv 13uU7lD/vpKJqy/f0S52wR8Cddx1vbOPP9gOZfg= X-Google-Smtp-Source: APXvYqwP7KwDUacRiLKoO20ON/l4Tv/mPHKC5Lwh+9Am2maSsSfqTX3MJWBsI1Gqu72NxjQUgzJGLeXodYHDAdSmamU= X-Received: by 2002:a2e:8ece:: with SMTP id e14mr6105989ljl.66.1554453678905; Fri, 05 Apr 2019 01:41:18 -0700 (PDT) MIME-Version: 1.0 References: <6d3be21f-d63a-3fc6-94ee-0bde8e313d66@xs4all.nl> <37bb451f-a1b2-4c69-91e2-f2ab6c4798e7@www.fastmail.com> In-Reply-To: <37bb451f-a1b2-4c69-91e2-f2ab6c4798e7@www.fastmail.com> Date: Fri, 5 Apr 2019 10:41:04 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Larry Garfield Cc: PHP Internals List Content-Type: multipart/alternative; boundary="00000000000059dfd30585c47348" Subject: Re: [PHP-DEV] RFC Draft: Comprehensions From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --00000000000059dfd30585c47348 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Larry, pt., 5 kwi 2019 o 03:55 Larry Garfield napisa=C5= =82(a): > > Advantages: > > * Very compact. > * Works for both arrays and traversables > * Would play very nicely with the proposed spread operator for iterables = ( > https://wiki.php.net/rfc/spread_operator_for_array). > IMO not nicely cause spread operator in current proposal raises an error on key preserved traversable[1]. This means example like below would fail $a =3D ['foo' =3D> true, ...[foreach($_GET as $key =3D> $value) yield $key = =3D> $value]]; // error [1] https://wiki.php.net/rfc/spread_operator_for_array#string_keys --=20 regards / pozdrawiam, -- Micha=C5=82 Brzuchalski about.me/brzuchal brzuchalski.com --00000000000059dfd30585c47348--