title: json_decode() returning error "Notice: Trying to get property of non-object"
body: <p>I am trying to write a script that gets a JSON file from a remote location (in this case being twitch.tv) using cURL (don't think that part is too relevant, though I better mention it anyway). For example purposes, lets say the JSON object it returns looks something like this after being stored in a variable: </p>
  
  <pre><code>$json_object = {"_links":{"self":"https://api.twitch.tv/kraken/streams/gmansoliver","channel":"https://api.twitch.tv/kraken/channels/gmansoliver"},"stream":null}
  </code></pre>
  
  <p>I access the "stream" property, I have tried the follow code:</p>
  
  <pre><code>&lt;?php
      $json_object = {"_links":{"self":"https://api.twitch.tv/kraken/streams/gmansoliver","channel":"https://api.twitch.tv/kraken/channels/gmansoliver"},"stream":null}
  
      $json_decoded = json_decode($json_object, true);
      echo $json_decoded-&gt;stream;
  ?&gt;
  </code></pre>
  
  <p>When I try this, I get the error "Notice: Trying to get property of non-object in D:\Servers\IIS\Sites\mysite\getstream.php on line 48".</p>
  
  <p>Am I using json_decode() wrong, or is there something wrong with the JSON object I am being sent from twitch?</p>
  
  <p>Edit:</p>
  
  <p>I now have the JSON object: </p>
  
  <pre><code>{"access_token": "qwerty1235","refresh_token": "asdfghjkl=","scope": ["user_read"]}
  </code></pre>
  
  <p>If I try to decode it using <code>json_decode()</code> I get the following error: <code>Object of class stdClass could not be converted to string</code>. Any advice?</p>
  
  <p>Thanks in advance for any help</p>