__set and Property Overloading
<pre><code>class object
{
    public function __construct() {}

    public function __set($property, $value) 
    { 
         $this-&gt;$property = $value;
    }

    public function __get($property) 
    {
        if (isset($property))
            return $this-&gt;$property;
    }
}
</code></pre>

<p>I get the concept of Property Overloading now. But I'm not entirely sure why the code have double $'s.</p>

<p>For example this statement: <code>$this->$property = $value;</code> versus the usual <code>$this->property = $value;</code></p>

<p>My guess is that the reason why both statement are different is: </p>

<p>The <code>$this->property = $value</code> statement is use when the class have explicitly defined property. To clarified, code with a property that is explicitly defined:
<code>class object { private $property; __construct(){} /<em>... setter, getter</em>/ }</code></p>

<p>Where as <code>$this->$property = $value;</code> is used for dynamically created property. So <code>$this->$property</code> is actually referring to the <code>_<em>set</code>'s $property argument. For clarity: <code></em>_set(<strong>$property</strong>,$value)</code>, the first <code>__set</code> method's argument (bolded). </p>

<p>Heck, maybe the code is just creating a new variable named <code>$property</code>, instead of referring to the 1st argument in the <code>__set</code>, and <code>$this-></code> is just forcing the class to acknowledge that the class have a new property...</p>
