title: difference between these two return statements in php
body: <p>we are wondering what is the best way to return <code>empty</code> <code>null</code> <code>no result</code> in php, we often use this</p>
  
  <pre><code>function doThis($a){
     if($a == 0){
         return '';
     }else{
         // complex mysql 
         return $result;
  }
  </code></pre>
  
  <p>one more way of doing it is </p>
  
  <pre><code>function doThis($a){
     if($a == 0){
         return null;
     }else{
         // complex mysql 
         return $result;
  }
  </code></pre>
  
  <p>now we compare like this</p>
  
  <pre><code>if(doThis(5)){
      // do something
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if(!is_null(doThis(5)){
      // do something
  }
  </code></pre>
  
  <p>i was wondering what is the best approach for doing this ?</p>