How can I get the data from an array that is returned by a method?
<p>I have a method that does cool magical stuff and then returns my results in the form of an array.</p>

<p>So for instance</p>

<pre><code>public function somemethod()
{
    some stuff that builds an array

    return $stuff;
}
</code></pre>

<p>If you do a</p>

<pre><code>$s = stuff();
print_r($s-&gt;somemethod());
</code></pre>

<p>You get something like</p>

<pre><code>array('a' =&gt; 'hi', 'b' =&gt; 'hello', 'c' =&gt; 'konnichiwa')
</code></pre>

<p>How can I access each array element?</p>

<pre><code>$s-&gt;somemethod()-&gt;a?
</code></pre>

<p><code>$s-&gt;somemethod()['a']</code> ?</p>
