----- Original Message -----
From: "Stig Venaas" <[EMAIL PROTECTED]>
To: "Andrey Hristov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, September 03, 2002 11:53 AM
Subject: Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] array_unique
broken?


> On Tue, Sep 03, 2002 at 11:47:58AM +0300, Andrey Hristov wrote:
> > IMO that's good idea to have keys ordered too. All my nightmares with
> > array_diff() came from that
> > the key order is undefined and I tried all kind of tricks (traversing
like
> > in a marathon forward and backwards to
> > find are there couples [k,v] that are identical).
>
> Note that the sorting in array_unique() is just for internal reasons,
> it did until recently determine which key was returned for a value
> though. I think for array_diff() and array_intersect() the ordering
> should be as in the first argument, current implementations do that.
> I don't think any sorting should be done except internally and that
> is just to make things efficient. If we need something like
> array_diff_associative() etc those should also do sorting internally
> for efficiency (I see no other way), and not rely on the unsorted
> output from array_diff() etc.
>
> Stig
>

Yup, I am talking about sorting for internal reasons.
array_diff_assoc(iative)() will share most of the code with array_diff() if
there is
a routine that guaratees that after sorting the keys in equal "value blocks"
will be
also sorted.

Andrey


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to