You can get the same output with for and while loops:
While:
$i = 0;
while ($i <= 10){
print $i.\"\\n\";
$i++;
};
Some optimizing compilers will be able to do better loop unrolling with a for loop, but odds are that if you're doing something that can be unrolled, a compiler smart enough to unroll it is probably also smart enough to interpret the loop condition of your while loop as something it can unroll as well.