title: why is json_decode of my php program does not returns object type
body: <p>I'm trying to json_decode on the API server of mine from my react app with fetch and decode a JSON data change into an object, but even after adding the false option, it still keeps returning array-type. </p>
  
  <p>json_decode(file_get_contents("php://input"),false) //not working</p>
  
  <p>I can get the data with array-type: $data['hoge'] but not $data->hoge</p>
  
  <pre><code>async submit(ev) {
          // User clicked submit
          ev.preventDefault();
  
          const data = {name: this.state.name, email: this.state.email};
  
  
          let {token}= await this.props.stripe.createToken(data);
          const post_data = JSON.stringify({token_id: token.id, site_id: this.state.site_id});
  
  
          let response = await fetch("http://localhost:8888/API/API/contact/create.php", {
              method: "POST",
              headers: {"Content-Type": "application/json",
                  Authorization: `Bearer ${this.key}`
              },
              body: post_data
          });
  
          if (response.ok) console.log("Purchase Complete!")
  
  
      }
  </code></pre>
  
  <pre class="lang-php prettyprint-override"><code>// Get raw data
  $data = json_decode(file_get_contents("php://input"),false);
  
  //var_dump
  ob_start();
  var_dump($data);
  $content = ob_get_contents();
  ob_end_clean();
  error_log($content,3,'./debug.txt');
  
  error_log('site_id', $data-&gt;site_id);
  </code></pre>
  
  <p>var_dump result: 
  /Users/k/Desktop/APPS/sql-test/API/API/contact/create.php:40:
          null</p>
  
  <pre><code>    /Users/k/Desktop/APPS/sql-test/API/API/contact/create.php:40:
      object(stdClass)[9]
      public 'token_id' =&gt; string 'tok_22vj0dL6qGzdvjd1tM2mAcfl' (length=28)
      public 'site_id' =&gt; string '15' (length=2)
  </code></pre>
  
  <p>Error log of the error_log('site_id', $data->site_id):</p>
  
  <p>[14-Jul-2019 00:28:50 UTC] PHP Notice:  Trying to get property 'site_id' of non-object in /Users/k/Desktop/APPS/sql-test/API/API/contact/create.php on line 49
  [14-Jul-2019 00:28:50 UTC] site_id</p>