This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Darkhorse
over 8 years

While loops- 2/7 - What am I doing wrong here? (Freezes)

My code:

Answer 56054e8a86f55241e0000783

0 votes

Permalink

why did you change the $loopCond = flase; into $loopCond == false; It is not necessary to compare, we must declare.

And the crash comes because you make a infinite loop!

BR D.

points
Submitted by Codmakr
over 8 years

3 comments

Amrita Khurana Matta over 8 years

while ($loopCond == true){ //Echo your message that the loop is running below echo “

The loop is running.

“; $loopCond = false; } echo “

And now it’s done.

“; ?>

Codmakr over 8 years

That is the right syntax

Amrita Khurana Matta over 8 years

$loopCond = false; do { echo “

The loop ran even though the loop condition is false.

“; } while (($loopCond) == true); echo “

Now the loop is done running.

“; ?>