Jump to content


This topic is now archived and is closed to further replies.


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

Recommended Posts

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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.