php arrayObj insensitive to undegined index
<p>How to make <code>ArrayObj</code> in insensitive to undefined index, I sometimes need use undefined index example in logging</p>

<pre><code>$this-&gt;log['some']['other']['info']++
</code></pre>

<p>Here is my try:</p>

<pre><code>class arrayInSensitive extends \arrayObject{

    var $data = array();

    public function offsetGet($name) {
        if(!array_key_exists($name,$this-&gt;data)) $this-&gt;data[$name]=new arrayInSensitive();

        return $this-&gt;data[$name];
    }
    public function offsetSet($name, $value) {
        $this-&gt;data[$name] = $value;
    }
    public function offsetExists($name) {
        return (array_key_exists($name,$this-&gt;data));
    }
    public function offsetUnset($name) {
        unset($this-&gt;data[$name]);
    }

}
</code></pre>

<p>How to do it ?</p>
