== or =


I am trying to understand why I would use == as apposed to =. I wrote an if else statement as follows:
// Write your if/elseif/else statement here!
$wall = "blue";
if ($wall = "white") {
echo "Boring";
else {
echo "That is interesting.";

The output showed "boring", but when I changed the if statement to have == it showed "That is interesting." Why would an = not be sufficient?


The above is an assignment where we need to write a comparison:

if ($wall == "white") {

The above condition tests for equality.