In this new post on Mgccl's blog today, there's a response to these benchmarks from John Walsh concerning which is faster - a for loop or a while loop.
In this new post, Mgccl, he points out two other examples that show that a while loop is always faster than a for loop. To help prove the point, he's also included a screencast where he shows the code he's using to run the benchmarks (several different tests).
His results, matching the results from the other reports, not only shows that the while loop is faster (still only slightly), but also consumes less memory in the process.







1) Don't do it!
2)(For experts only) Don't do it yet!
The problem with these discussions is that they are lots of talk about something with no impact whatsoever. None. I challenge anybody to find me a script that is not performant with while loops but by changing to for loops you get sufficient performance!
The fact is you should be writing PHP with an eye towards the semantics of your code. "for" loops (whether marginally slower or not) should be used because their semantics are obvious (a loop of fixed duration with associated counter variable).
Rewriting a for loop like that to a while loop makes your code less obvious and less maintainable. And of course saving .005% of the total execution time of the script or 1kb of memory does not justify writing obfuscated code - if you need performance use static caching or an opcode cache or db cache or memcache or rewrite computationally intensive portions as a c module. Any of these avenues is likely to give you execution gains on orders of magnitude that are actually useful...
Arguing about which style loop is marginally more performant, on the other hand, is just useless and encourages the newbies to worry about precisely the wrong things. And of course this goes double for advice on single quotes versus double quotes!