title: How does an 'if' statement checking happen in memory?
body: <p>Please read the code below:</p>
  
  <pre><code>&lt;?php
      $flag = 1;
      $name = $_GET['name'];
      if($name == NULL){
         $flag = 0;
      }
  
   // some more code and checking....
   ?&gt;
  </code></pre>
  
  <p>Here most of the time 'name' parameter will not be 'NULL' . If it is null, i am setting an error flag to 0. 
  I was told that we have to use positive approach in programming. ie Since most of the time 'name' parameter is not going to be 'NULL' I should write the above code as:</p>
  
  <pre><code>if($name != NULL){
    $flag=1;
  }else{
    $flag =0;
  }
  </code></pre>
  
  <p>The above code improves performance because of the way the 'if' statement checking($name == NULL and $name != NULL) works.(this is what was told)</p>
  
  <p>Does this kind of positive approach help improve performance?
  How does an 'if' statement check for the 'if' condition in memory?</p>
  
  <p>Thanks in advance.</p>