所以在我的代碼有:問題與PHP數組和500錯誤
var_dump($poll);
它打印:
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) { }
}
,然後我想做的事:
var_dump($poll["parent"]["objectId"]);
但隨後它給我一個500內部服務器錯誤。任何想法爲什麼這是?
UPDATE: 從錯誤中拉日誌,它說:
PHP Fatal error: Cannot use object of type stdClass as array