Isn't it because probably you don't see that this is a string containing Json and you need to decode it first otherwise it's just a string variable and not an object?
See json_decode
Docs:
$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
var_dump(json_decode($json));
object(stdClass)#1 (5) {
["a"] => int(1)
["b"] => int(2)
["c"] => int(3)
["d"] => int(4)
["e"] => int(5)
}