Possible Duplicate:
Casing an Array with Numeric Keys as an Object
I made a casting from array to object and I'm confused:
$arr = range(1,3);
$obj = (object) $arr;
var_dump($obj)
object(stdClass)#2 (5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
The question is: How to access the object attributes in this case? $obj->0 causes syntax error.
$obj->{0}fails as well?