Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61405 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3826 invoked from network); 18 Jul 2012 14:55:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2012 14:55:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vb0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:33041] helo=mail-vb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/1D-39169-07EC6005 for ; Wed, 18 Jul 2012 10:55:44 -0400 Received: by vbbfs19 with SMTP id fs19so1363880vbb.29 for ; Wed, 18 Jul 2012 07:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=T8HVjTHvnX7CeybW+JVBQHtH7iu1JwIypFCIscBtwrQ=; b=Sh9z4TwhFLRMGumVkW6KeW7RsiqM2FwySNFBPou5weoiO9FjQfXLHxgc/i3t4EHjkW eMiHsgeO/etuuDdqsUP/1t246++oZyXap83tLGuYcidHOxWICiJn8OaA2ZZhuYuPYo/x N7DpGpQabwfZ37zuPsDLuYH5NnSNwf6qAmqbDvSX4Hi/biK1L0C+gAb71FUi9A2Xjuys 6GeBsamSFUtlXADX5ngNluS/IH7kAUuGks963cp12GFj0f0HNT0Se7Mqdw2ilUAeRGKU l2TFYfh9wQcpi68o8SQ0tU0556IoPQwa8qL6rt6uvAtWOObbakfy7EpfCBK7NQ/18UFg 8DtQ== Received: by 10.220.225.194 with SMTP id it2mr1001637vcb.32.1342623341927; Wed, 18 Jul 2012 07:55:41 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.221.11.74 with HTTP; Wed, 18 Jul 2012 07:55:21 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Jul 2012 22:55:21 +0800 X-Google-Sender-Auth: JiQBy0wwXdGnDTQVEb-NJIGwKU4 Message-ID: To: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [RFC] foreach_variable supporting T_LIST From: laruence@php.net (Laruence) On Wed, Jul 18, 2012 at 10:49 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. thanks phidev's good english, he re-wrote the descriptions. thanks > > 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/ -- Laruence Xinchen Hui http://www.laruence.com/