[TYPO3-core] RFC: Bug #7669: Change elderly while(list()=each()) to foreach calls in t3lib_tstemplate

Oliver Hader oh at inpublica.de
Tue Feb 26 14:58:42 CET 2008


Hi Steffen,

Steffen Kamper schrieb:
> "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
> 
> +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) {
> ?

Of course. I'm going to change this before the commit. Additionally 
there are some more formatting issues in t3lib_tstemplate which will be 
solved in a different patch/RFC.

olly
-- 
Oliver Hader
http://inpublica.de/


More information about the TYPO3-team-core mailing list