title: Change array key without changing order
body: <p>You can <a href="https://stackoverflow.com/questions/240660/in-php-how-do-you-change-the-key-of-an-array-element">"change" the key of an array element</a> simply by setting the new key and removing the old:</p>
  
  <pre><code>$array[$newKey] = $array[$oldKey];
  unset($array[$oldKey]);
  </code></pre>
  
  <p>But this will move the key to the end of the array.</p>
  
  <p>Is there some elegant way to change the key without changing the order?</p>
  
  <p>(PS: This question is just out of conceptual interest, not because I need it anywhere.)</p>