title: multiple conditions and assignment in php
body: <p>An easy question about how php behaves:</p>
  
  <p>getColor is a function of class Circle which returns  either false or an object with the color as an attribute. If I do:</p>
  
  <pre><code>$res=$circle-&gt;getColor();
  if ($res &amp;&amp; $res-&gt;color=='white')
  {
      echo "ok";
   } else {
      echo "no";
   }
  </code></pre>
  
  <p>I get "ok", but if I do</p>
  
  <pre><code>if ($res=$circle-&gt;getColor() &amp;&amp; $res-&gt;color=='white')
  {
      echo "ok";
   } else {
      echo "no";
   }  
  </code></pre>
  
  <p>I get "no". Why? I thought first condition is executed first. Isn't it?</p>