So in my code I have:
var_dump($poll);
which prints:
object(stdClass)#2 (9) {
["parent"]=> object(stdClass)#3 (3) {
["className"]=> string(5) "Venue"
["__type"]=> string(7) "Pointer"
["objectId"]=> string(10) "HRSCYpe2FK"
}
["no"]=> int(0)
["updatedAt"]=> string(24) "2011-11-06T23:37:17.917Z"
["creator"]=> object(stdClass)#4 (3) {
["className"]=> string(5) "_User"
["__type"]=> string(7) "Pointer"
["objectId"]=> string(10) "96K81tdpM4"
}
["createdAt"]=> string(24) "2011-11-06T23:37:14.591Z"
["yes"]=> int(1)
["objectId"]=> string(10) "U8ly32582W"
["question"]=> string(20) "Negozio conveniente?"
["reports"]=> object(stdClass)#5 (0) { }
}
and then I want to do:
var_dump($poll["parent"]["objectId"]);
but then it gives me a 500 internal server error. Any idea why this is?
UPDATE:
Pulling from the error log it says:
PHP Fatal error: Cannot use object of type stdClass as array
Looks like your
$pollvariable is astdclassin which case, you would access the properties like soAs for your 500 status, at a guess I’d say PHP is configured to trigger this for errors.