Reputation: 7891
I get the response below from a script, and I need to extract board, model, serial number, current and upgrade.
Net\Response Object
(
[unrecognizedWords:protected] => Array
(
)
[_type:Net\Response:private] => !re
[attributes:protected] => Array
(
[board] => true
[model] => CRD
[serialnumber] => XXXXXXXX
[current] => 5.11
[upgrade] => 5.11
)
[_tag:Net\Message:private] =>
)
I've multiple combinations such as this:
echo unrecognizedWords:protected->attributes:protected->board;
However I can not get the values our of the array.
Can someone help me?
Upvotes: 0
Views: 31
Reputation: 970
You cann't get any protected or private properties of object (only public). Use public methods (getters) of this object (sure, that it's provided).
Read: PHP: Visibility
Upvotes: 1