0
Can for loop execute without initialization?
2 ответов
+ 2
Yes, for loop can execute without initialization IF a variable used for loop counter, or a variable needed is already defined before the loop.
For example:
$i = 1;
for(; $i <= 5; $i++) // no initiailization
{
echo $i . '<br />';
}
+ 1
Thank you.