title: Does variables' order matter when doing == and === comparisons?
body: <p>Does it really matter to put variables after <code>==</code> or <code>===</code> when doing comparisons?</p>
  
  <pre><code>if (null == $var) {
  
  }
  
  if ($var == null) {
  
  }
  </code></pre>
  
  <p>I've constantly seen coders prefer this way, is it for speed difference?</p>
  
  <p>Updates:</p>
  
  <p>Sorry I didn't make my question clear, what I want to know is not the different between <code>==</code> and <code>===</code>, but expressions like <code>null == $var</code> and <code>$var == null</code>, so I've changed the code example.</p>
  
  <hr>
  
  <p><strong>Conslusion</strong>:</p>
  
  <p>No functional or performance difference. Some consider it a best practice or simply a coding style. BTW it has a cool name: Yoda Conditions :)</p>
  
  <p>FYI: PHP error messages use this style, e.g.</p>
  
  <pre><code>PHP Fatal error:  Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
  </code></pre>
  
  <hr>
  
  <p>Don't know why this question is marked duplicated to (<a href="https://stackoverflow.com/questions/2063480/the-3-different-equals?lq=1">The 3 different equals</a>) not (<a href="https://stackoverflow.com/questions/13222070/whats-the-difference-between-false-var-and-var-false">What&#39;s the difference between &#39;false === $var&#39; and &#39;$var === false&#39;?</a>)</p>