I'm guessing you cast an enumerated array into an object for some reason? If so, you've run into a Catch 22 due to the fact that in PHP, "Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores" [from http://www.php.net/manual/en/language.variables.basics.php].
If you need to directly access an element, you could cast it back to an array:
$arr = (array) $obj;
echo $arr[0];
Better yet, though, would be figuring out why you got into this situation in the first place and see if some re-factoring is called for in order to make it a non-issue.