6/7 I can not find a mistake in my code


#1







<?php
$loopCond = false;
do
{
echo "he loop ran even though the loop condition is false";
}while ($loopCond = true)
echo"Now the loop is done running.";

?>
</body>


#2

Here you have my code

   <?php
    		$loopCond = false;
    		do {
    			echo "<p>The loop ran even though the loop condition is false.</p>";
    		}
    		while ($loopCond);
    		echo "<p>Now the loop is done running.</p>";
        ?>

#4

I had the same challenge thanks for the answer. But why is the =false or equal to true not working with the loop?


#5

Please tell me nearer what you mean ?!


#6

I mean why is this "<?php
$loopCond = false;
do
{
echo "he loop ran even though the loop condition is false";
}while ($loopCond = true)
echo"Now the loop is done running.";" not right?


#7

Cause you didnt compare while ($loopCond = true)

Here how you should compare from the manaul
while($a == $b) // TRUE if $a is equal to $b after type juggling.

All Comparison Operators - php manual


#8

Thanks.... I used single equal to as assignment instead of double == as comparison. I shall check this out again.


#9

($var) is exacly the same as ($var == true), but if u would use longer notification it would not work in this exercise but fortunatly just here :smile: