Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65579 invoked from network); 6 Jul 2011 13:15:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jul 2011 13:15:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=neufeind@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=neufeind@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 91.184.32.3 as permitted sender) X-PHP-List-Original-Sender: neufeind@php.net X-Host-Fingerprint: 91.184.32.3 mail.speedpartner.de Linux 2.5 (sometimes 2.4) (4) Received: from [91.184.32.3] ([91.184.32.3:36608] helo=mail.speedpartner.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/00-65332-6EF541E4 for ; Wed, 06 Jul 2011 09:15:20 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.speedpartner.de (Postfix) with ESMTP id 55991B3CB4 for ; Wed, 6 Jul 2011 15:15:16 +0200 (CEST) Received: from mail.speedpartner.de ([127.0.0.1]) by localhost (mail.speedpartner.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PQfqOr83ga9o for ; Wed, 6 Jul 2011 15:15:16 +0200 (CEST) Received: from collab.speedpartner.de (collab.speedpartner.de [91.184.32.10]) by mail.speedpartner.de (Postfix) with ESMTP id 3B788B3AEB for ; Wed, 6 Jul 2011 15:15:16 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.speedpartner.de (Postfix) with ESMTP id 3609050103 for ; Wed, 6 Jul 2011 15:15:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at collab.speedpartner.de Received: from collab.speedpartner.de ([127.0.0.1]) by localhost (collab.speedpartner.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1TA1OXqVE8Cj for ; Wed, 6 Jul 2011 15:15:15 +0200 (CEST) Received: from sn-dell.local.neufeind.net (dslb-084-062-065-043.pools.arcor-ip.net [84.62.65.43]) by collab.speedpartner.de (Postfix) with ESMTPSA id 966C6500FD for ; Wed, 6 Jul 2011 15:15:15 +0200 (CEST) Message-ID: <4E145FE2.5000001@php.net> Date: Wed, 06 Jul 2011 15:15:14 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] foreach_variable supporting T_LIST token From: neufeind@php.net (Stefan Neufeind) Hi, On 07/06/2011 03:06 PM, Hannes Magnusson wrote: > 2011/7/6 Xinchen Hui : >> >> T_LIST is not allowed to used with foreach before. >> >> and then there comes a freature request: #10203 allow >> foreach($array as list($a,$b) > > Ironically enough you managed to miss the last closing ), enforcing > the point of this not being a natural syntax. > > Furthermore, without reading the RFC, is this the same as > foreach($array as $a => $b) {} No, there $a would be the key. Intention would be, as I read the RFC, that this could be an arbitrary list. > or > foreach($array as $e) { > list($a, $b) = $e; > } Yes, I understood if like that. Just a short notation. > or.. ? > > that really doesn't look like something PHP should support imo. Don't see too many bad things about the idea ... Regards, Stefan