title: Function thinks passed variable is empty (it is not!)
body: <p>My PHP function thinks my variable ($type) that I am passing to it is empty, but when I tell the function to return that variable ($ype), it returns exactly what I pasted to it.</p>
  
  <pre><code>function getData($result, $player = 0, $type = 0){
       // This is here for me to test the bug and it prints $type ok, how when its == 0 ?
      if ($type == 0){ return $type; }
      if (!empty($result) AND $type != 0){
          return $result[$player]-&gt;$type;
      }elseif (!empty($result) AND $type == 0){
          return $result[$player];
      }else{
          return FALSE;
      }
  }
  </code></pre>
  
  <p>This is how I call that function in the code:</p>
  
  <pre><code>$map_type = getData($replay, 1, "name");
  </code></pre>
  
  <p>Can there be a problem that the file with functions is included? I think nope, as other files and even functions within that file work ok.</p>
  
  <p>I checked it multiple times and I do not see a typos there and I actually tested it and it worked OK.</p>
  
  <p>Is there some bug with setting variables to 0 when they are not sent to function? Again, I dont think so, as the $player works and similar code works on my other functions too.</p>