title: return empty array in php
body: <p>I have a function that returns an array, and is passed to foreach i.e.</p>
  
  <pre><code>foreach(function() as $val)
  </code></pre>
  
  <p>Since the array I am returning is declared in a series of if statements, I need to return an empty array if all the if statements are evaluated to false. Is this a correct way to do it?</p>
  
  <pre><code>if (isset($arr))
    return $arr;
  else 
    return array();
  </code></pre>