Setting a value inside an array designated by a named property
<p>If I have the following code:</p>

<pre><code>$a = new stdClass();
$property = 'test';

$a-&gt;$property = array();
</code></pre>

<p>How can I set a value inside the <code>$a-&gt;$property</code> array? The following doesn't work, because <code>[]</code> is applied on <code>$property</code>, not on <code>$a-&gt;$property</code>:</p>

<pre><code>$a-&gt;$property['key'] = 'value';
</code></pre>

<p>Is referencing the property the only way of doing this?</p>

<pre><code>$array = &amp;$a-&gt;$property;
$array['key'] = 'value';
</code></pre>
