ID: 42863
User updated by: moloth at hotmail dot com
-Summary: array_merge_recursive() magles values
Reported By: moloth at hotmail dot com
Status: Open
Bug Type: Arrays related
Operating System: all
PHP Version: 5.2.4
New Comment:
Changed Summary
Previous Comments:
------------------------------------------------------------------------
[2007-10-05 14:27:23] moloth at hotmail dot com
Changed Summary
------------------------------------------------------------------------
[2007-10-05 14:19:01] moloth at hotmail dot com
Changed to arrays related
------------------------------------------------------------------------
[2007-10-05 08:00:33] moloth at hotmail dot com
Description:
------------
Seems to increment number values.
Reproduce code:
---------------
<pre>
<?php
$a = array('a' => array('2' => '6'));
$b = array('a' => array('2' => '6'));
$result = array_merge_recursive( $a, $b );
print_r( $result );
?>
Expected result:
----------------
Array
(
[a] => Array
(
[2] => 6
)
)
Actual result:
--------------
Array
(
[a] => Array
(
[2] => 6
[3] => 6
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42863&edit=1