title: JSON_ENCODE of multidimensional array giving different results
body: <p>When doing a json_encode a multidimensional array in PHP, I'm noticing a different output simply by naming one of the arrays, as opposed to not naming them.  For Example:</p>
  
  <pre><code>$arrytest = array(array('a'=&gt;1, 'b'=&gt;2),array('c'=&gt;3),array('d'=&gt;4));
  json_encode($arrytest)
  </code></pre>
  
  <p>gives a single array of multiple json objects</p>
  
  <pre><code>[{"a":1,"b":2},{"c":3},{"d":4}];
  </code></pre>
  
  <hr>
  
  <p>whereas simply assigning a name to the middle array</p>
  
  <pre><code>$arrytest = array(array('a'=&gt;1, 'b'=&gt;2),"secondarray"=&gt;array('c'=&gt;3),array('d'=&gt;4));
  json_encode($arrytest)
  </code></pre>
  
  <p>creates a single json object with multiple json objects inside</p>
  
  <pre><code>{"0":{"a":1,"b":2},"secondarray":{"c":3},"1":{"d":4}};
  </code></pre>
  
  <p>why would the 1st option not return the same reasults as the 2nd execpt with "1" in place of "secondarray"</p>