Re: cvs: php-src /ext/standard array.c

From: Date: Tue, 17 Feb 2009 18:11:11 +0000
Subject: Re: cvs: php-src /ext/standard array.c
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-43076@lists.php.net to get a copy of this message
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

« previous php.internals (#43076) next »