Concept
What happens when a while loop never increments its counter?
ComputerScienceOne / For Loops
"In the while loop, we never increment the counter variable $i, the loop does nothing, and so the computation will continue on forever! It is valid PHP and will run, but obviously won’t work as intended. Avoid this problem by using proper syntax."
Related Ideas
- Why should a while-loop condition not end with a semicolon in PHP?ComputerScienceOne · While Loops
- Why should you avoid a semicolon after a while condition?ComputerScienceOne · While Loops
- Why should you avoid a semicolon after a while-loop condition?ComputerScienceOne · While Loops
- How are while loops structured and styled in PHP?ComputerScienceOne · While Loops
- How is a basic while loop structured in Java?ComputerScienceOne · While Loops