This for loop will assign $i with three and increment it by 1.
for($i = 3, $i < 10, 1) //Do something end for
This for loop will assign $i to $j and increment $i by 2.
$j = 4 for($i = $j, $i < 10, 2) //Do something end for
This for loop will not instantiate $i but will inform the loop that $i is the value to increment.
$i = 3 for($i, $i < 10, 1) //Do something end for
As of version 1.4.2, for loops can be written in the exact syntax of a C-style for loop in that the
$i++ can be used in place
of the increment or decrement value. Placing a pre-decrement or pre-increment expression such as
--$i will result in
the value being changed before the for loop iterates.
for($i = 3; $i < 10; $i++) //Do something end for
YASS also supports an alternative syntax, similar to VB.NET, that uses the
for($i = 0 to 10) //Do something end for
As with all loops, for loops may be terminated by
This loop is much faster than the PHP style of loop as well.
for($i = 3, $i < 10, 1) //Do something end loop
In reality, the YASS for...to loop is considerably higher performance compared with the PHP style version.