title: PHP, better to set the variable before if or use if/else?
body: <p>So a simple one that I just never could find a straight answer on.</p>
  
  <p>What is better (performance or otherwise):</p>
  
  <pre><code>$var = false;
  If ($a == $b) {
      $var = true;
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>If ($a == $b) {
      $var = true;
  } else {
      $var = false;
  }
  </code></pre>
  
  <p>I've heard arguments for both ways. I find the first cleaner to ensure I have it set, and a little less code too. The pro being that you may only need to set it once without conditional. But the con being that if the argument is true, it gets set twice.</p>
  
  <p>I am assuming the second way is probably best practice</p>