Moriyoshi Koizumi wrote:
Ilia Alshanetsky wrote:
I've discussed this issue with Andrei at least a month ago (if not
longer) when the patch was originally added, and I believe that the
introduced behavior is the correct one.

IMO correct or not depends on the context where the function is used.

At least, as array_unique() was not capable of dealing with objects
before the Andrei's patch, every existing code should use it with
strings, not objects.

If SORT_REGULAR could handle objects as well as strings in the same
manner as SORT_STRING I wouldn't see any problem, although it cannot.

SORT_STRING can only reliably deal with strings - its behavior on non-string type is basically broken. Unless we agree that PHP is Tcl (strings are the only type), then SORT_REGULAR makes much more sense to me, and evidently others.

If you really have a huge problem with BC, perhaps we could leave the default behavior as SORT_STRING for 5.2.x, but it definitely needs to be SORT_REGULAR for 5.3/6.

-Andrei

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

Reply via email to