A for loop is only another syntax for a while loop. Everything which is possible with one of them is also possible with the other one. Any for loop where the termination condition can never be met will be infinite : for($i = 0; $i > -1; $i++) { … }
Read moreHow do you do infinite loops?
All apps on your iPhone use infinite loops, because they start running, then continually watch for events until you choose to quit them. To make an infinite loop, just use true as your condition . true is always true, so the loop will repeat forever.
Read moreWhat causes a loop to be infinite?
An infinite loop occurs when a condition always evaluates to true . … This is a silly example, but it’s common for infinite loops to accidentally occur. Most of the times, it’s because the variables used in the condition are not being updated correctly, or because the looping condition is in error.
Read moreCan an infinite for loop be created?
A for loop is only another syntax for a while loop. Everything which is possible with one of them is also possible with the other one. Any for loop where the termination condition can never be met will be infinite : for($i = 0; $i > -1; $i++) { … }
Read more