[TYPO3-core] RFC: Bug #7669: Change elderly while(list()=each()) to foreach calls in t3lib_tstemplate
Steffen Kamper
steffen at sk-typo3.de
Tue Feb 26 14:48:46 CET 2008
"Oliver Hader" <oh at inpublica.de> schrieb im Newsbeitrag
news:mailman.1.1204033209.24389.typo3-team-core at lists.netfielders.de...
> This is a SVN patch request.
>
> Problem:
> There are many old while(list()=each()) calls in t3lib_tstemplate. Some
> of them are buggy becaus the internal array pointer has to be resetted
> then walking through an array by each().
> One current side-problem is that in some PHP5 versions TypoScript
> constants are not substituted correctly - due to a missing reset($array).
>
> Solution:
> Change these iterations to use foreach() and clean up the whole class a
> bit.
>
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=7669
>
> Branch: Trunk
>
>
> olly
> --
> Oliver Hader
> http://inpublica.de/
>
Hi olly,
+1 by reading. I don't like the list anyway, so this is more clear and no
hidden errors because no reset is needed.
One nit:
foreach ($pathArr as $p) {
can you change that to
foreach ($pathArr as $path) {
?
vg Steffen
More information about the TYPO3-team-core
mailing list