Bifalgorithm post · Computer science one · For Loops
What happens when a while loop never increments its counter?
What happens when a while loop never increments its counter? (Computer science one · For Loops) — "In the while loop, we never increment the counter variable $…
Ideas in this flowchart
- Un while sans incrémentation de $i ne fonctionne pas comme prévu
- La variable compteur $i n'est jamais incrémentée
- La boucle ne fait rien
- Le calcul continue indéfiniment
- Le code est valide en PHP et s'exécute
- Le comportement obtenu ne correspond évidemment pas à l'intention
- Il faut utiliser une syntaxe appropriée pour éviter ce problème