|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2008-12-20 16:53 UTC] jani@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 17:00:02 2025 UTC | 
Description: ------------ After using "array_unshift" (and the first key is numeric) the first (old) key of the array has changed. We use PHP 5.2.5 (API 20041225) Reproduce code: --------------- $test = array("4711" => "4711", "Hello" => "Hello"); print_r($test); array_unshift($test, array(null => "New text")); print_r($test); Expected result: ---------------- Array ( [4711] => 4711 [Hello] => Hello ) Array ( [0] => Array ( [] => New text ) [1] => 4711 [Hello] => Hello ) Actual result: -------------- Array ( [4711] => 4711 [Hello] => Hello ) Array ( [0] => Array ( [] => New text ) [4711] => 4711 [Hello] => Hello )