Cannot use object of type stdClass as array
-
Hello,
My previous post was closed as it was not for the current version of the plugin but problem still persists.
Solution: Use the second parameter of json_decode on effected lines to make it return an array:
$result = json_decode($data, true);
source: https://stackoverflow.com/questions/6815520/cannot-use-object-of-type-stdclass-as-array
2014/01/29 22:39:24 [error] 2947#0: *140010 FastCGI sent in stderr: “PHP message: PHP Fatal error: Cannot use object of type stdClass as array in /xxxxxxxxxx/www/wp-content/plugins/floating-social-bar/class-floating-social-bar.php on line 687” while reading response header from upstream, client: xx.xx.xxx.xxx, server: festivalarchive.com, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, upstream: “fastcgi://unix:/dev/shm/php-fpm-www.sock:”, host: “www.xxxxxxx.com”, referrer: “https://www.xxxxxx.com/xxxxxx/”
It would be good if this simple fix would be added in future releases.
thanks,
Paul
- The topic ‘Cannot use object of type stdClass as array’ is closed to new replies.