Getting "Indirect modification of overloaded property has no effect" notice
<p>I want to use a Registry to store some objects. Here is a simple Registry class implementation. </p>

<pre><code>&lt;?php
  final class Registry
  {
    private $_registry;
    private static $_instance;

    private function __construct()
    {
      $this-&gt;_registry = array();
    }

    public function __get($key)
    {
      return
        (isset($this-&gt;_registry[$key]) == true) ?
        $this-&gt;_registry[$key] :
        null;
    }

    public function __set($key, $value)
    {
      $this-&gt;_registry[$key] = $value;
    }

    public function __isset($key)
    {
      return isset($this-&gt;_registry[$key]);
    }

    public static function getInstance()
    {
      if (self::$_instance == null) self::$_instance = new self();
      return self::$_instance;
    }
}

?&gt;
</code></pre>

<p>When I try to access this class, I get "Indirect modification of overloaded property has no effect" notification.</p>

<pre><code>Registry::getInstance()-&gt;foo   = array(1, 2, 3);   // Works
Registry::getInstance()-&gt;foo[] = 4;                // Does not work
</code></pre>

<p>What do I do wrong?</p>
