Re: while cs. for

From: Date: Fri, 20 Aug 1999 18:54:18 +0000
Subject: Re: while cs. for
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-10037@lists.php.net to get a copy of this message
If you're talking about PHP 3.0 then yes. There definitely is a difference between the two loops. The for loop is less efficient. It's not because of how the grammer is written but because of the architecture of PHP 3.0. Andi At 01:18 PM 8/20/99 -0400, David Sklar wrote:
In some benchmarking I'm doing, while() loops are a little faster than equivalent for loops. Is this just a side-effect of how the parser rules are written? e.g, the two loops I'm comparing are: $j = 0; while ($j < $iter) {
    $a = 1;
    $j++;
} and for ($j = 0; $j < $iter; $j++) {
    $a = 1;
} -dave -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#10037) next »