Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61403 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1909 invoked from network); 18 Jul 2012 14:54:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2012 14:54:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:50127] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/AC-39169-92EC6005 for ; Wed, 18 Jul 2012 10:54:34 -0400 Received: by wibhn17 with SMTP id hn17so4076952wib.11 for ; Wed, 18 Jul 2012 07:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=H6CML+kfZnBak4K4oFm/90sPlsWDoOjkNh+fAeaHhFM=; b=Mz6goTIB98b6DZecI8l0bbqe96qPVpPn+foWRqNLGTkeRF/R6Es6oblXC+ZJ7vY3z+ Wzu/EDtjS5yPNGEsGASVFMQXoXNfO/io3D2Xx+cAyx4QHzGLmnDwjuF5r5kIkWPPM0t3 Yxyh02igRiUt+y3j+dd91+TyWgF+xf0t9X7f6pYuqI9t/gxS5TDCXsH3J/7TAUdskMXP Xk57I6qiiAsioWfS3xlfVIcNAUiyeVTt52o3fQe5R1WfQtSE7BEEOBuwcQnNV3QjNM2F UQTuA2tdJAVo+IrUJPRLNYoQBYv8lhU+zszmUU/mmbBKVDGG/8pgECx3hjG66tyWfCNt L3uw== MIME-Version: 1.0 Received: by 10.180.76.135 with SMTP id k7mr7271503wiw.7.1342623271191; Wed, 18 Jul 2012 07:54:31 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Wed, 18 Jul 2012 07:54:31 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Wed, 18 Jul 2012 07:54:31 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Jul 2012 15:54:31 +0100 Message-ID: To: Laruence Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d043c7e9225830204c51bd7b4 Subject: Re: [PHP-DEV] [RFC] foreach_variable supporting T_LIST From: ajfweb@googlemail.com (Andrew Faulds) --f46d043c7e9225830204c51bd7b4 Content-Type: text/plain; charset=UTF-8 Sounds great. Python has something similar for tuples, would be good if PHP had this. Are there any BC concerns? Don't see why this could break something. On Jul 18, 2012 3:50 PM, "Laruence" wrote: > Hi: > this is not a new RFC, I proposed it before, but due to my poor > english and improper examples, it didn't get passed. > > This feature introduces list() support in foreach constructs(more > info can be found here: https://wiki.php.net/rfc/foreachlist): > > $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. "; > } > ?> > > what do you think? personally, I really think it's a good feature. > > what about commit this into trunk(php 5.5) ? > > thanks > > -- > Laruence Xinchen Hui > http://www.laruence.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d043c7e9225830204c51bd7b4--