News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



John Walsh's Blog:
PHP Benchmark - For vs While
2 comments :: posted Monday March 26, 2007 @ 15:19:23
voice your opinion now!

John Walsh filled us in on a new set of benchmarks he worked up comparing two of the standard looping structures in PHP - for versus while.

People always ask me what statement is faster, so I've gone ahead and created a benchmark test using Apache's AB Benchmarking tool. There's no reason not to use For either, you can use it with any while statement but While in some cases mean's less lines, but i prefer speed than less lines of code.

He created some simple scripts to perform the tests and ran them through the AB benchmarker to come up with his results - with while just barely edging out the for loop by one millisecond.

tagged with: benchmark loop forloop whileloop apache tool millisecond benchmark loop forloop whileloop apache tool millisecond





zendframework conference PHP5 zend PEAR database job pecl releases mysql code release developer book security application framework ajax package cakephp

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework