Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104703 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 18072 invoked from network); 14 Mar 2019 01:40:29 -0000 Received: from unknown (HELO mail-wm1-f54.google.com) (209.85.128.54) by pb1.pair.com with SMTP; 14 Mar 2019 01:40:29 -0000 Received: by mail-wm1-f54.google.com with SMTP id y15so860178wma.0 for ; Wed, 13 Mar 2019 15:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=3318EsvRqLoCvphquS1QDTFM5pHCi9g6cTZ9rSBIHQ0=; b=j/cN/ugDXb9FZTj52lSkf47eZkqoWr1al7kAOJt5gjhs8FuLrnNUzcCBldNsra8/em u+ufuJ72sBSuRixKn9IiPamm/2ZijOj5gu+p84Zt60ecQv6whwEP3Dc3398hjphWlaoo DqBeo3xEITQo6mKIKoomk8r9n7WxzmFzotidtV+cS9hwFvXtBsSENTxe8u1WkLqyDXmd KF4u46pU1KPa90wxw6qNEX3D7TiguPIkIP63Dr2Uo++UEARp8AhqwFCtI3FqTsbEYQ5L tSmftt1XFRvqAA0Ln7hjvpA7XUBpQMcS769kbFyJP1HgeO9y+dIfgiyBc6IB/1eklBfv N5sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=3318EsvRqLoCvphquS1QDTFM5pHCi9g6cTZ9rSBIHQ0=; b=M45sDfQZQ/J1O/D/tluXDhkZu7/iBvsBdgNxb4A8FdwnTD/xLqasw7SgTpiwSQj5sq nWlBNTFMZvpNZLRMs45vmiKyJH5Qfk9aVxTJ/W7aciXrDsPo6/lvfqKjscJ9dkk7FV6H FxnnWkhQTrazrpUi/vNajfCVZiBwP2wPtMpDYWsfOvFHXykf/yhUH2LWlIwEbeqJOglI QZ1VayZf9q8uka44ahJfBM0l/6RLfgSt4l7GkoyJTIN5A7U2lujoEsmOzJBhLMTMHMMO nAtqjFLuK9q7X9MZbikxBMx1dzjvUF+g/aeso9TUQdw+0m6zqLr0ftLw2sa6G501qHiJ ZrCQ== X-Gm-Message-State: APjAAAX+F2sTGYAn0BrNBPcsUxiR1A0uXxsCuNW0GxddGZ6su3b+PSzS 8rQWgXogydOBUgWolTHF73gg2TnY X-Google-Smtp-Source: APXvYqwoi/CKElgDiyMn7PgzQvTkXA+1gRRTXX6Fb/V7tnzreT5MHaB00F5O5ZHVYQ1AX1zT/qdUJA== X-Received: by 2002:a1c:6506:: with SMTP id z6mr250638wmb.153.1552516242527; Wed, 13 Mar 2019 15:30:42 -0700 (PDT) Received: from [192.168.0.16] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id u17sm39614687wrg.71.2019.03.13.15.30.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 15:30:41 -0700 (PDT) To: internals@lists.php.net References: <6d3be21f-d63a-3fc6-94ee-0bde8e313d66@xs4all.nl> Message-ID: Date: Wed, 13 Mar 2019 22:30:40 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <6d3be21f-d63a-3fc6-94ee-0bde8e313d66@xs4all.nl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] RFC Draft: Comprehensions From: rowan.collins@gmail.com (Rowan Collins) On 13/03/2019 21:10, Dik Takken wrote: > So in practice, I expect that > using comprehensions as proposed in the new RFC will also require doing > a lot of iterator_to_array(). A dual comprehension syntax could fix that. At risk of complicating things further, might the solution to that be to have a shorter syntax for iterator_to_array in general? It's a shame array-casts are defined for arbitrary objects, else we could have (array)$iterator - and therefore (array)[foreach ($users as $user) yield $user->firstName] Regards, -- Rowan Collins [IMSoP]