Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61586 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33256 invoked from network); 20 Jul 2012 22:28:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 22:28:33 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.113 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.113 smtp113.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.113] ([67.192.241.113:47467] helo=smtp113.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/40-18983-F8BD9005 for ; Fri, 20 Jul 2012 18:28:32 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp11.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 8159BD1202; Fri, 20 Jul 2012 18:28:28 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp11.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 3047FD11FC; Fri, 20 Jul 2012 18:28:28 -0400 (EDT) Message-ID: <5009DB8B.4050207@sugarcrm.com> Date: Fri, 20 Jul 2012 15:28:27 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Andrew Faulds CC: PHP Internals , Laruence References: <5009933E.4060003@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] foreach_variable supporting T_LIST From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > If I understand this correctly, this is like what Python let's you do > with tuples. It's handy for getting vector components, hostnames and > port numbers, etc. (I apologise for the Python comparison, it is just > the language where I usually encounter this, and it makes heavy use of > foreach-style loops and tuples) There's no need to apologize for Python comparison, Python is not a dirty word :) However, in PHP functions rarely return sets of tuples that can be manageably unpacked by this foreach syntax - usually it's either something like DB result set, which has unpredictable number of values, or one set of values, which doesn't need foreach. That's why I wanted to see a use case where this is beneficial. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227