Bug #17303 Updated: Error in array_merge
| From: | mfischer@php.net | Date: | Sat, 18 May 2002 09:36:01 +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-7976@lists.php.net to get a copy of this message | ||
ID: 17303
Updated by: mfischer@php.net
Reported By: hardword@web.de
Status: Open
-Bug Type: Arrays related
+Bug Type: Documentation problem
Operating System: Mandrake 8.2
PHP Version: 4.2.0
New Comment:
Expected, but probably not well documented behaviour. Only string keys
are preserverd.
Use $merged_array = $array1 + $array2; for your purpose.
Making a documentation problem.
Previous Comments:
------------------------------------------------------------------------
[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