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

Franz Koch typo.removeformessage at fx-graefix.de
Tue Jul 14 03:33:08 CEST 2009


Franz Koch wrote:
> Hi,
> 
>> variant 4
>> - reset($inArray);
>> - while(list($fN,$fV)=each($inArray)) {
>> + foreach ($inArray as $fN => $v) {
>                                -----
> 
> there seems to be a bug. It has to be $fN => $fV (line 90 in the 
> patchfile). But I haven't checked of $fV is used in that function as I 
> only had a look at the patch.

ok - just checked it - it's not used, so it's not a "bug". But another 
thing I stumbled upon:

--- line 60 in patchfile ---
$confLL = $this->conf['_LOCAL_LANG.'];
foreach($confLL...
----------------------------
It's not vital, but wouldn't a referenced copy save some bytes here? 
Same in lines 134 and 731 of the patch.



And now a real bug that should be fixed :)

--- line 502 in patch ----
-	while(list(,$val)=each($altRootLine))	{
+	foreach ($rootLine as $val) {
--------------------------
it has to be $altRootLine(!) according to the surrounding code.
              -----


after that change I give my nonCoreDev+1 by reading. Thanks for your 
work on this.

-- 
kind regards,
Franz Koch

---------------------------------------------------
PayPal-Account: 'paypal _at_ elements-net _dot_ de'
---------------------------------------------------


More information about the TYPO3-team-core mailing list