PHP Benchmark - For vs While from John's PHP Digest starts the FOR VS WHILE argument again.
For VS While was already a topic in the old days:
Bruesoft's real time benchmark on loops changes result each request. Cosmin Budinschi's test show WHILE is faster than FOR.
I believe this is an endless fight, but I'm in the WHILE's side.
WHILE is FASTER! and USE LESS MEMORY
I have to support it with one of the best method ever(found out 3 days ago)
Screencast!
BTW if you can't see it, check out the revver page where my screencast is shown.
In this screencast, you will see that WHILE is slightly faster and it uses less memory!
Comments
just curios
Yep for is faster than while... i didn't like while, but sometimes it goes just better :)
P.S. what editor you use in screencast?
the editor is Emeditor The
the editor is Emeditor
The free edition is nice... but the pro is amazing...
It's popular around Chinese community because it's nice support of non-English characters.
but it can be slow when working with super large files(like... 50MB.. but really... why open something that big...)
I saw sublime text on your blog... neat stuff... thumbnail view of the document is a first in text editors...
Pingback
[...] quick search for “for vs while php” landed me on Mgccl’s blog, where last year, he had tested and benchmarked exactly this with a lovely little [...]
Optimized out
The $a is never being used after the loop, so it may just get optimized out.
Post new comment