[PHP-DEV] Re: Bug #12480 Updated: array_merge_recursive() clobbers existing numeric keys

2001-08-06 Thread Peter Lowe
On Aug 06, Bug Database wrote: 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. uhm, forgive me

Re: [PHP-DEV] Re: Bug #12480 Updated: array_merge_recursive() clobbers existing numeric keys

2001-08-06 Thread Andrei Zmievski
On Mon, 06 Aug 2001, Peter Lowe wrote: On Aug 06, Bug Database wrote: 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

Re: [PHP-DEV] Re: Bug #12480 Updated: array_merge_recursive() clobbers existing numeric keys

2001-08-06 Thread Peter Lowe
On Aug 06, Andrei Zmievski wrote: On Mon, 06 Aug 2001, Peter Lowe wrote: On Aug 06, Bug Database wrote: 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

Re: [PHP-DEV] Re: Bug #12480 Updated: array_merge_recursive() clobbers existing numeric keys

2001-08-06 Thread Andrei Zmievski
On Mon, 06 Aug 2001, Peter Lowe wrote: I agree, you *should* preserve all elements of the input array in the output one, one of those elements being the key. it actually says on the man page: If, however, the arrays have the same numeric key, the later value will not

Re: [PHP-DEV] Re: Bug #12480 Updated: array_merge_recursive() clobbers existing numeric keys

2001-08-06 Thread Peter Lowe
On Aug 06, Andrei Zmievski wrote: What would you have them start with? :) Imagine this scenario: $array1 = array('a', 'b', 'c'); $array2 = array(2='d', 3='e', 4='f'); $result = array_merge($array1, $array2); In this case, $result is: Array ( [0] = a

Re: [PHP-DEV] Re: Bug #12480 Updated: array_merge_recursive() clobbers existing numeric keys

2001-08-06 Thread Andrei Zmievski
On Mon, 06 Aug 2001, Peter Lowe wrote: this: would be: Array ( [0] = a [1] = b [2] = c [3] = e [4] = d [5] = f ) with e and d swapped round. any value in $array2 that already