Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61587 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34652 invoked from network); 20 Jul 2012 22:32:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 22:32:04 -0000 Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:55198] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/90-18983-26CD9005 for ; Fri, 20 Jul 2012 18:32:03 -0400 Received: by wibhq12 with SMTP id hq12so816046wib.11 for ; Fri, 20 Jul 2012 15:31:59 -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=z8G8jgiQpWJjaIJPGVo4Ds0j2t+romtrQxH82Itz5T8=; b=Kb54pyJd+NRiRJphbgYeYv/peNZdTleShkSZSrCoRZtdeL+kmJ24g+W2x9zz2FKFm/ jgL9xRsmeTAVoaBTee3IRo4JVW8KTe0T1TgnKh6t5UoY/ePUNtyYISNtdozT15SAh/in zNszSi4nA1uyUATwA6mfADI/iOfDqJdcMg/zARVd20J2DXB+ibHpm2v+7jjGdnWa1G45 pa6Zjox+o74k3B29uqLay2HTsUHhCDIGYirKd0MR0sF0nWuF8M3pRkfknrkZgyI/P1qn kvx0TvLZwhILWslep3p4ZacC3WkPl9LU4yXi4FaW49MJDCNlfTXCuccNNlzdxYFYZeNZ Coww== MIME-Version: 1.0 Received: by 10.216.220.89 with SMTP id n67mr5028486wep.73.1342823518900; Fri, 20 Jul 2012 15:31:58 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Fri, 20 Jul 2012 15:31:58 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Fri, 20 Jul 2012 15:31:58 -0700 (PDT) In-Reply-To: <5009DB8B.4050207@sugarcrm.com> References: <5009933E.4060003@sugarcrm.com> <5009DB8B.4050207@sugarcrm.com> Date: Fri, 20 Jul 2012 23:31:58 +0100 Message-ID: To: Stas Malyshev Cc: PHP Internals , Laruence Content-Type: multipart/alternative; boundary=0016e6d77ce3d7149304c54a760a Subject: Re: [PHP-DEV] Re: [RFC] foreach_variable supporting T_LIST From: ajfweb@googlemail.com (Andrew Faulds) --0016e6d77ce3d7149304c54a760a Content-Type: text/plain; charset=UTF-8 Yeah, that's what I realised as I wrote that. PHP functions don't really use tuples etc. very much, unlike Python. That said, now we have short array syntax, and if we add this, perhaps people will use it more. Still, at the moment the usefulness of this is limited. Perhaps destructuring assignment with objects? So o->x and o->y to $a and $b? On Jul 20, 2012 11:28 PM, "Stas Malyshev" wrote: > 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 > --0016e6d77ce3d7149304c54a760a--