Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-28 Thread Benjamin Eberlei
You can build an iterator to do this for you, doesn't need to be in the language IMHO On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller wrote: > Hi internals, > > during my current work I had an idea for shorter array iteration with > foreach. I haven’t seen such a syntax until now, but I think

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Tjerk Anne Meesters
On Fri, Jun 28, 2013 at 1:36 AM, Pierre du Plessis wrote: > On Thu, Jun 27, 2013 at 7:29 PM, Tjerk Anne Meesters wrote: > >> On Fri, Jun 28, 2013 at 1:13 AM, Pierre du Plessis >> wrote: >> >> > On Thu, Jun 27, 2013 at 6:14 PM, Johannes Schlüter >> > wrote: >> > >> > > On Thu, 2013-06-27 at 16:58 +

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Pierre du Plessis
On Thu, Jun 27, 2013 at 7:29 PM, Tjerk Anne Meesters wrote: > On Fri, Jun 28, 2013 at 1:13 AM, Pierre du Plessis > wrote: > > > On Thu, Jun 27, 2013 at 6:14 PM, Johannes Schlüter > > wrote: > > > > > On Thu, 2013-06-27 at 16:58 +0200, Nikita Popov wrote: > > > > On Thu, Jun 27, 2013 at 4:10 PM, Ch

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Tjerk Anne Meesters
On Fri, Jun 28, 2013 at 1:13 AM, Pierre du Plessis wrote: > On Thu, Jun 27, 2013 at 6:14 PM, Johannes Schlüter > wrote: > > > On Thu, 2013-06-27 at 16:58 +0200, Nikita Popov wrote: > > > On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller > >wrote: > > > > > > > The new syntax could make it shorte

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Pierre du Plessis
On Thu, Jun 27, 2013 at 6:14 PM, Johannes Schlüter wrote: > On Thu, 2013-06-27 at 16:58 +0200, Nikita Popov wrote: > > On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller >wrote: > > > > > The new syntax could make it shorter and faster to write... but maybe > it's > > > a bit too confusing? > > >

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Patrick ALLAERT
2013/6/27 Johannes Schlüter : > On Thu, 2013-06-27 at 16:58 +0200, Nikita Popov wrote: >> On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller wrote: >> >> > The new syntax could make it shorter and faster to write... but maybe it's >> > a bit too confusing? >> > >> > $count = 0; >> > foreach ($array

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Johannes Schlüter
On Thu, 2013-06-27 at 16:58 +0200, Nikita Popov wrote: > On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller wrote: > > > The new syntax could make it shorter and faster to write... but maybe it's > > a bit too confusing? > > > > $count = 0; > > foreach ($array as $key => $innerArray as $innerKey =

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Nikita Popov
On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller wrote: > The new syntax could make it shorter and faster to write... but maybe it's > a bit too confusing? > > $count = 0; > foreach ($array as $key => $innerArray as $innerKey => $value) { > $count += $value; > // and do something with $k

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Yahav Gindi Bar
On Thu, Jun 27, 2013 at 5:27 PM, Ralf Lang wrote: > On 27.06.2013 16:10, Christian Stoller wrote: > > Hi internals, > > > > during my current work I had an idea for shorter array iteration with > foreach. I haven’t seen such a syntax until now, but I think it is easy to > understand ;-) > > > > M

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Ralf Lang
On 27.06.2013 16:10, Christian Stoller wrote: > Hi internals, > > during my current work I had an idea for shorter array iteration with > foreach. I haven’t seen such a syntax until now, but I think it is easy to > understand ;-) > > Maybe you know the case where you have to iterate over all va

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Sebastian Krebs
2013/6/27 Florin Patan > On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller > wrote: > > Hi internals, > > > > during my current work I had an idea for shorter array iteration with > foreach. I haven’t seen such a syntax until now, but I think it is easy to > understand ;-) > > > > Maybe you kno

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Sebastian Krebs
2013/6/27 Kingsquare.nl - Robin Speekenbrink > I'd thought this would have been `solved` by allowing the list statement in > foreach ( > > http://nl3.php.net/manual/en/control-structures.foreach.php#control-structures.foreach.list > ) > > Doesnt that solve your problem already? > This is only us

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Kingsquare.nl - Robin Speekenbrink
I'd thought this would have been `solved` by allowing the list statement in foreach ( http://nl3.php.net/manual/en/control-structures.foreach.php#control-structures.foreach.list ) Doesnt that solve your problem already? Kind regards, Robin Speekenbrink 2013/6/27 Florin Patan > On Thu, Jun 27

Re: [PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Florin Patan
On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller wrote: > Hi internals, > > during my current work I had an idea for shorter array iteration with > foreach. I haven’t seen such a syntax until now, but I think it is easy to > understand ;-) > > Maybe you know the case where you have to iterate

[PHP-DEV] New syntax for multidimensional array loop with foreach

2013-06-27 Thread Christian Stoller
Hi internals, during my current work I had an idea for shorter array iteration with foreach. I haven’t seen such a syntax until now, but I think it is easy to understand ;-) Maybe you know the case where you have to iterate over all values of a 2D (or more) array: $count = 0; foreach ($array a