Is it possible to access to object member as if array member?
for example
echo $a->b;
to
echo $a[b];
Would it be any php ini settings, or this is quite impossible in PHP?
Is it possible to access to object member as if array member?
for example
echo $a->b;
to
echo $a[b];
Would it be any php ini settings, or this is quite impossible in PHP?
extends ArrayObject
or implements ArrayAccess
so you can access the object as array.
Reading Material
I tried for a one-liner but:
$x = (array)$a;
echo $x['b'];
Or of course to convert the object: $a = (array)$a;