[TYPO3-core] RFC #0011512: replace while(list()...) by foreach in the TYPO3 core part 1

Niels Pardon typo3_lists at niels-pardon.de
Thu Jul 16 11:49:11 CEST 2009


http://php.net/foreach says:

"When foreach first starts executing, the internal array pointer is
automatically reset to the first element of the array. This means that
you do not need to call reset() before a foreach  loop."

Greets,

Niels


Benjamin Mack schrieb:
> Hey Rupi,
> 
> http://www.phpbench.com/
> 
> see Read Loop:foreach() vs. for() vs. while(list() = each())
> 
> Citing:
> "In all cases I've found that the foreach loop is substantially faster
> than both the while() and for() loop procedures. One thing to note is
> that when using an entire loop from the start it's extremely good to use
> the reset() function in all examples"
> 
> All the best,
> Benni.


More information about the TYPO3-team-core mailing list