Confused on how php objects handle arrays
<p>The output of this is "24", when I'd expect "44".<br>
 

<pre><code>class some_class {
    public $array = array();

    public function construct() {
        $this-&gt;array[5] = 4;
    }

    public function something() {
        // $this-&gt;array at this point is empty, why?
        echo (isset($this-&gt;array[5])) ? $this-&gt;array[5] : 2;
        $this-&gt;array[5] = 4;
        // Here, $this-&gt;array holds the value 4 in the key 5 correctly
        echo (isset($this-&gt;array[5])) ? $this-&gt;array[5] : 2;
    }
}

$some_object = new some_class();
$some_object-&gt;something();
</code></pre>

<p>Any ideas why my expectations are being shattered?</p>
