PHP referring to object data with numerical key
<p>I have converted an array to object data like this:</p>

<pre><code>&lt;?php
$myobject-&gt;data = (object)Array('zero','one','two);
print_r($myobject);
?&gt;
</code></pre>

<p>And the output is:</p>

<blockquote>
  <p>stdClass Object ( [data] => stdClass
  Object ( [0] => zero [1] => one [2] =>
  two ) )</p>
</blockquote>

<p>So far so good. But if I try to refer to the numerical keys...</p>

<pre><code>&lt;?php
$myobject-&gt;data = (object)Array('zero','one','two);
$counter = 1;
echo $myobject-&gt;data-&gt;$counter;
?&gt;
</code></pre>

<p>...nothing is returned! I would expect it to echo "one".</p>

<p>Am I doing it wrong?</p>
