ID: 12480
Updated by: andrei
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Arrays related
Operating System: FreeBSD
PHP Version: 4.0.6
New Comment:

array_merge* functions are not meant to preserve numeric keys.

Previous Comments:
------------------------------------------------------------------------

[2001-07-31 05:14:43] [EMAIL PROTECTED]

if any of the keys of the first level of arrays are
numeric, using array_merge_recursive() will renumber
them to start at 0. this destroys keys that are used
to record id numbers, etc.

[mini:pgl]:~/public_html $ cat test.php 
#!/usr/local/bin/php -q
<?
$b[a][4] = 1;
$a[3][4] = 2;
print_r(array_merge_recursive($a, $b));
?>

[mini:pgl]:~/public_html $ ./test.php 
Array
(
    [0] => Array
        (
            [4] => 2
        )

    [a] => Array
        (
            [4] => 1
        )
)


------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=12480&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to