Bug #17303 Updated: Error in array_merge

From: Date: Sat, 18 May 2002 09:56:00 +0000
Subject: Bug #17303 Updated: Error in array_merge
References: 1  Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-7977@lists.php.net to get a copy of this message
ID: 17303 Updated by: mfischer@php.net Reported By: hardword@web.de -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Mandrake 8.2 PHP Version: 4.2.0 New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-05-18 05:36:01] mfischer@php.net Expected, but probably not well documented behaviour. Only string keys are preserverd. Use $merged_array = $array1 + $array2; for your purpose. Making a documentation problem. ------------------------------------------------------------------------ [2002-05-18 05:18:22] hardword@web.de $array1=(); $array2=(1=>"data"); print_r(array_merge($array1,$array2)); /* this will print out array ( 0 => "data" ) and should be array ( 1=>"data" ) */ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17303&edit=1

« previous php.bugs (#7977) next »