Jump to content


Photo

Slow slow foreach, just to help anyone else....


  • Please log in to reply
No replies to this topic

#1 Slowchaos

Slowchaos
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 September 2006 - 07:35 PM

In case anyone else has stumbled across this problem....

I recently downloaded and installed PHP5. After getting is setup manually I found that a particular page was loading extremely slow. By slow, I mean > 2 minutes! With my previous installation of PHP4 the page took only milli-seconds to display. The script for the page was loading mysql database results into an array of objects which I then put through FOREACH loops to fill rows and columns of data (parts). It was the loops that were taking so long to execute in PHP5. After much experimenting I discovered that my new php.ini file was still set for error reporting of E_ALL. When I changed it to E_ERROR the problem went away even though there were NO errors of any kind within the loops.

My setup: WinXP, PHP5 - latest snapshot, Apache 2.0.5.

Note: I upgraded from latest stable downloads of PHP5 and Apache 2.0 in attempts to correct this issue without success.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users