Accessing StdClass value with colon :protected

后端 未结 4 900
旧巷少年郎
旧巷少年郎 2021-01-26 03:11

How do I access the value of stdClass with colon \":protected\"?

For example, I had this $obj with these result :

object(Google_Service_Plus_PeopleFeed)         


        
4条回答
  •  甜味超标
    2021-01-26 03:44

    It's not a stdClass object, it's an object of the class Google_Service_Plus_PeopleFeed. You cannot access protected properties of a class [easily]. If the class doesn't want you to access the data, then you shouldn't. But typically the class offers some method you can call to get the data, like $obj->getData() or some such. Look at the class definition or its documentation to see how you're supposed to use the class.

提交回复
热议问题