Why doesn't empty(0) return false?
<pre><code>&lt;?php
class Stack{
private $_data = array();
private $_end = null;
public function push($data){
    if($this-&gt;_end === null){
        $this-&gt;_end = 0;
    }else{
        $this-&gt;_end = $this-&gt;_end + 1;
    }
    $this-&gt;_data[$this-&gt;_end] = $data;
}

public function pop(){
    if(empty($this-&gt;_data)){
        return false;
    }

    $ret = $this-&gt;_data[$this-&gt;_end];

    array_splice($this-&gt;_data, $this-&gt;_end);
    $this-&gt;_end--;

    return $ret;
}

public function getData(){
    return $this-&gt;_data;
}
}

// test
$stack = new Stack();
$stack-&gt;push(0);
$pop_data = $stack-&gt;pop();
var_dump($pop_data, $stack-&gt;getData());
</code></pre>

<p>Why doesn't <code>empty(0)</code> return <code>false</code>? I push <code>0</code> to the <code>pop_data</code>. <code>empty($this-&gt;_data)</code> should return <code>false</code>, but the result of the test is <code>int(0)</code>. I am puzzled.</p>
