Is it possible to set a class property by name?
<p>Simple question here... I was wondering if it's possible to access class propertys by it's name in any way.</p>

<p>Imagine this scenario:</p>

<pre><code>$array = array(
    'foo' =&gt; 'bar',
    'hello' =&gt; 'world',
    'chuck' =&gt; 'norris'
);
</code></pre>

<p>And then have this class:</p>

<pre><code>class MegaClass {
    public $foo, $hello, $chuck;
}
</code></pre>

<p>I was wondering if I could set <code>MegaClass::foo</code> to <code>bar</code>, <code>MegaClass::hello</code> to <code>world</code> and so on, automatically. So, given the array, and given the object, the object is filled. This could be really handy when retreiving data from a form with properties filled...</p>
