[TYPO3-core] RFC: #13670: Performance optimization: change while(list() to foreach()

Lars Houmark lars at houmark.com
Mon May 17 19:45:28 CEST 2010


Hi Steffen,

Steffen Kamper wrote:
> these errors astonish me - hopefully it was the last one.

It wasn't. After seeing all of these follow-ups, I got a bit concerned 
and decided to read the v5 patch from Steffen. Yes boring, but I found 
that this part of the patch is breaking the fe_adminLib.inc file 
completely due to syntax error:

-			reset($this->conf['parseValues.']);
-			while(list($theField,$theValue)=each($this->conf['parseValues.']))	{
+			while(list($theField,$theValue)=each())	{
+			foreach ($this->conf['parseValues.'] as $theField => $theValue) {
  				$listOfCommands = t3lib_div::trimExplode(',',$theValue,1);

Notice the empty each. And actually that entire line with the while 
needs to be removed, since the foreach is replacing it.

I am not convinced that I did not miss another one, and I really think 
this one needs another look by more eyes in order to make sure something 
serious is not broken.

Also, is time to reconsider if a post-commit syntax error validation 
hook should be implemented in the SVN? At least it will catch things 
like this.

Attached is another follow-up patch that can should be committed in 
order to unbreak fe_adminLib.inc.

-- 
Lars Houmark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 13670_followup_feadminlib.diff
Type: text/x-diff
Size: 575 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100517/c5a430de/attachment.diff>


More information about the TYPO3-team-core mailing list