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-loop condition?ComputerScienceOne · While Loops
- Why should you avoid a semicolon after a while condition?ComputerScienceOne · While Loops
- How are while loops structured and styled in PHP?ComputerScienceOne · While Loops
- How does a do-while loop differ from a while loop in PHP?ComputerScienceOne · Do-While Loops
- How does a flag-controlled while loop work in Java?ComputerScienceOne · While Loops
- How do do-while loops differ from while loops in Java?ComputerScienceOne · For Loops
- How do do-while loops differ from while loops in C?ComputerScienceOne · For Loops