title: Php class property get and set
body: <p>I have the following codes.  </p>
  
  <pre><code>&lt;?php
  class Reg {
      private $pros = array();
      public function __set($key,$val) {
          $this-&gt;pros($key)= $val;
      }
  
      public function __get($key) {
            return $this-&gt;pros($key);
      }     
  }
  $reg= new Reg;
  $reg-&gt;tst="tst";
  echo $reg-&gt;tst;
  ?&gt;
  </code></pre>
  
  <p>But when executing this script I got the error following.<br>
    Fatal error : can't use method return value in write context in line 5</p>
  
  <p>I believe that to add an element to array is possible like the above.</p>
  
  <pre><code> $array = array();    
   $array('key')='value';
  </code></pre>
  
  <p>Please make clear that I was wrong.<br>
  Thanks</p>