ID: 42863 Updated by: [EMAIL PROTECTED] Reported By: moloth at hotmail dot com -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: all PHP Version: 5.2.4 New Comment:
>From the manual page for array_merge_recursive: "If, however, the arrays have the same numeric key, the later value will not overwrite the original value, but will be appended." Try adding this before the array_merge_recursive() call and you'll see what's happening: var_dump($a,$b); Previous Comments: ------------------------------------------------------------------------ [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