Re: [PHP-DEV] while cs. for From: Andi Gutmans (andi <email protected>)
Date: 08/20/99

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 <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>

---
Andi Gutmans <andi <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>