How do I retireve a value from an Object converted to array in php?
arrays, php
Solution
https://bugs.php.net/bug.php?id=45959
Unfortunately this is a known issue about which you can do nothing.
If you are stuck with an object of this type from an external source, the best bet would be cast it back to an array to get the value:
$input = (object)(array) 123;
$array = (array) $input;
echo $array[0];
Problem
I want to retrieve the value converted to array and then to object.. ``` $input = (object)(array) 123; var_dump($input); ``` This outputs: ``` object(stdClass)#1 (1) { [0]=> int(123) } ``` How do I retrieve the value 123 from `$input` ?