Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62481 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42747 invoked from network); 25 Aug 2012 12:37:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2012 12:37:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.133 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.133 oxmail.registrar-servers.com Received: from [64.22.89.133] ([64.22.89.133:49916] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/E6-06857-007C8305 for ; Sat, 25 Aug 2012 08:37:20 -0400 Received: from [192.168.0.200] (5ad3285b.bb.sky.com [90.211.40.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id DB7517580A2; Sat, 25 Aug 2012 08:37:16 -0400 (EDT) Message-ID: <5038C6DE.5080107@ajf.me> Date: Sat, 25 Aug 2012 13:36:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Laruence CC: PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [VOTE]Call for voting: support use list in foreach From: ajf@ajf.me (Andrew Faulds) On 25/08/12 13:33, Laruence wrote: > Hi: > Voting closed. > > Result: > foreach supports list syntax: 11 for yes, 4 for no. accepted. > foreach supports list with silent token: 2 for yes, 10 for no. denied. > > thanks for your great advise. > > I will commit the patch later. > > thanks > > On Sat, Aug 18, 2012 at 12:34 PM, Laruence wrote: >> Hi: >> This feature introduces list() support in foreach constructs(more >> info can be found here: https://wiki.php.net/rfc/foreachlist). >> >> this could make the grammar more consistent, see following example: >> >> > $users = array( >> array('Foo', 'Bar'), >> array('Baz', 'Qux'); >> ); >> >> // Before >> foreach ($users as $user) { >> list($firstName, $lastName) = $user; >> echo "First name: $firstName, last name: $lastName. "; >> } >> >> // After >> foreach ($users as list($firstName, $lastName)) { >> echo "First name: $firstName, last name: $lastName. "; >> } >> ?> >> >> previous discussion could be found at : >> http://marc.info/?l=php-internals&m=134277050215818&w=2 >> >> please vote for this: https://wiki.php.net/rfc/foreachlist#vote >> >> thanks :) >> >> -- >> Laruence Xinchen Hui >> http://www.laruence.com/ > > Great, now I can do in PHP what I've been able to do in Python for years, but with uglier syntax! :P -- Andrew Faulds http://ajf.me/