Problem with __get and __set code
<p>I don't know where I am doing wrong. Can somebody show me?</p>

<pre><code>&lt;?php 
    class something
    {
        public $attr1;
        private $attr2;

        public function __get($name)
        {
            return $this-&gt;$name;
        }

        public function __set($name,$value)
        {
            $this-&gt;$name = $value." added something more";
        }
    }

    $a = new something();

    $a-&gt;$attr1 = "attr1";
    $a-&gt;$attr2 = "attr2";

    echo $a-&gt;$attr1; //what I would expect is attr1 as output
    echo $a-&gt;$attr2; //what I would expect is attr2 added something more as output
?&gt;
</code></pre>
