title: Why does json_decode without assoc work different on PHP 5.6 and PHP 7.2
body: <p>i have now spen hours to analyse arrays on different servers.</p>
  
  <p>my little code:</p>
  
  <pre><code>echo "Current PHP version: " . phpversion() . "\r\n";
  
  $return = '{"status":"ok","message":"","code":"200","data":{"1234":{"sid":1,"name":"foo"},"4321":{"sid":2,"name":"bar"}}}';
  $nr = "1234";
  
  $json_data = json_decode($return, true);
  $data = $json_data['data'];
  if(isset($data[$nr])){
      echo "$nr found.\r\n";
  }else{
      echo "$nr not found.\r\n";
  }
  
  
  $json_data = json_decode($return);
  $data = (array) $json_data-&gt;data;
  if(isset($data[$nr])){
      echo "$nr found.\r\n";
  }else{
      echo "$nr not found.\r\n";
  }
  </code></pre>
  
  <p>Produces different output:</p>
  
  <pre>
  Current PHP version: 7.2.0
  1234 found.
  1234 found.
  </pre>
  
  <pre>
  Current PHP version: 5.6.8
  1234 found.
  1234 not found.
  </pre>
  
  <p>so why is:</p>
  
  <pre><code>$json_data = json_decode($return, true);
  $data = $json_data['data'];
  </code></pre>
  
  <p>not the same as</p>
  
  <pre><code>$json_data = json_decode($return);
  $data = (array) $json_data-&gt;data;
  </code></pre>
  
  <p>on Servers with PHP 5.6</p>
  
  <p>on both is $data an array, but on PHP 5.6 the isset does not work
  on the array properly.</p>