title: get_object_vars returning different results depending on PHP version
body: <p>This isn't really a surprise that function implementations change sometimes from version to version, but not like this... Look:</p>
  
  <pre><code>$array = ["abc","def"];
  $object = new stdclass();
  foreach($array as $index =&gt; $value) {
      $object-&gt;$index = $value;
  }
  var_dump(get_object_vars($object));
  </code></pre>
  
  <p>For 5.6.x and then e.g. 7.0.17 and 7.1.3 we get:</p>
  
  <pre><code>array(2) { 
  [0]=&gt; string(3) "abc" 
  [1]=&gt; string(3) "def" 
  }
  </code></pre>
  
  <p>But for 7.0.0 and 7.0.16 and 7.1.0 we get:</p>
  
  <pre><code>array(2) { 
  ["0"]=&gt; string(3) "abc" 
  ["1"]=&gt; string(3) "def" 
  } 
  </code></pre>
  
  <p>demo: <a href="https://3v4l.org/jog4A" rel="nofollow noreferrer">https://3v4l.org/jog4A</a></p>
  
  <p>See? The keys are integers OR strings, depending on version.</p>
  
  <p>Why? What is the reasoning behind those changes? And why isn't this documented anywhere? Or... is it?</p>