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 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php