title: Why does PHP cURL drop numeric keys?
body: <p>I'm trying to use cURL to POST an array containing numeric indices, but curl_setopt is dropping the numeric indices. I'm using PHP Version 5.3.29.</p>
  
  <p>Here's a simple script I setup to illustrate what is happening:</p>
  
  <pre><code>&lt;?php
  
  $is_curled = isset($_GET['curl']) ? !!$_GET['curl'] : false;
  
  if (!$is_curled) {
      $url = $_SERVER['SCRIPT_URI'] . '?curl=1';
  
      $_POST['1'] = 'test1234';               // dropped because numeric
      $_POST[234] = 'test3211';               // dropped because numeric
      $_POST['t3'] = 'test1325';              // NOT dropped
      $_POST['4t'] = 'test6347';              // NOT dropped
      $_POST['_5'] = 'test3235';              // NOT dropped
      $_POST['*4'] = 'test7432';              // NOT dropped BUT gets the NEXT POST value
      $_POST["3"] = 'test8521';               // dropped because numeric
      $_POST['"2"'] = 'test9472';             // NOT dropped because the string "2"
      $_POST["'1'"] = 'test2741';             // NOT dropped because the string '1' BUT gets the NEXT POST value
      $_POST["10"] = 'test1738';              // dropped because numeric
      $_POST['test_field'] = 'test6123';      // NOT dropped
  
      $ch = curl_init();
  
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);       // this drops numeric keys
  
      echo '&lt;pre&gt;' . print_r($_POST, 1) . '&lt;/pre&gt;';
  
      curl_exec($ch);
  
      curl_close($ch);
  
  } else {
      echo '&lt;pre&gt;' . print_r($_POST, 1) . '&lt;/pre&gt;';
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre><code>Array
  (
      [1] =&gt; test1234
      [234] =&gt; test3211
      [t3] =&gt; test1325
      [4t] =&gt; test6347
      [_5] =&gt; test3235
      [*4] =&gt; test7432
      [3] =&gt; test8521
      ["2"] =&gt; test9472
      ['1'] =&gt; test2741
      [10] =&gt; test1738
      [test_field] =&gt; test6123
  )
  Array
  (
      [t3] =&gt; test1325
      [4t] =&gt; test6347
      [_5] =&gt; test3235
      [*4] =&gt; test8521
      ["2"] =&gt; test9472
      ['1'] =&gt; test1738
      [test_field] =&gt; test6123
  )
  </code></pre>
  
  <p>What's even weirder, is not only are some indices dropped, but the values appear to be shifted in the ones next to the ones that are dropped.</p>