Original code:
if (!isset($result['errors'])) {
Result:
Fatal error: Cannot use object of type stdClass as array in _Somefilepath_\StormTwitter.class.php on line 155
Correcting code to:
if (!isset($result->errors)) {
Result:
This is a var_dump of the resulting array which is as expected.
array(1) { ["error"]=> string(115) "Something went wrong with the twitter request: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}" }.
It seems that for some reason the results array has become an object. Correcting this solves the issue.
Not sure if this is a global wp thing or just a quirk on my install.
Original code:
if (!isset($result['errors'])) {
Result:
Fatal error: Cannot use object of type stdClass as array in _Somefilepath_\StormTwitter.class.php on line 155
Correcting code to:
if (!isset($result->errors)) {
Result:
This is a var_dump of the resulting array which is as expected.
array(1) { ["error"]=> string(115) "Something went wrong with the twitter request: {"errors":[{"message":"Sorry, that page does not exist","code":34}]}" }.
It seems that for some reason the results array has become an object. Correcting this solves the issue.
Not sure if this is a global wp thing or just a quirk on my install.