title: Why can I infere that TRUE == FALSE in php?
body: <p>A friend of mine recently showed my the following snippet</p>
  
  <pre><code>&lt;?php
      $a = 0;
      $b = 'x';
      if(FALSE == $a &amp;&amp; $a == $b &amp;&amp; $b == TRUE) {
           echo 'WTF!?';
      }
  ?&gt;
  </code></pre>
  
  <p>which ouputs <code>WTF!?</code></p>
  
  <p>I understand why <code>FALSE == $a</code> holds, because zero is considered to be <code>FALSE</code>. I also understand why <code>$b == TRUE</code> holds, because the string is not empty. But I didn't understand why <code>$a == $b</code> is true, could somebody explain to me what type coercion rules play together here to get this rather amusing result?</p>