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" <smalys...@sugarcrm.com> 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 >