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 ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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: