Re: for/foreach speed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you very much. When we might have time for testing we can
wager :))

Am Montag, den 20.08.2007, 13:21 -0400 schrieb Robert Cummings:
> On Mon, 2007-08-20 at 18:50 +0200, Sascha Braun, CEO @ fit-o-matic
> wrote:
> > Hi people,
> > 
> > could somebody please explain me, what loop construct is
> > faster? The for, while or foreach.
> 
> I haven't bothered testing but I'd wager $5 that the following is the
> fastest loop:
> 
> <?php
> 
> while( 1 )
> {
> }
> 
> ?>
> 
> Depending on bytecode creation though, the following might be just as
> fast:
> 
> <?php
> 
> for( ;; )
> {
> }
> 
> ?>
> 
> Cheers,
> Rob.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux