Re: [PHP4BETA] rsort() bug?
| From: | Andrei Zmievski | Date: | Wed, 10 May 2000 17:11:41 +0000 |
| Subject: | Re: [PHP4BETA] rsort() bug? | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14767@lists.php.net to get a copy of this message | ||
On Wed, 10 May 2000, Sascha Schumann wrote:
> The problem is the behaviour of compare_function.
>
> For "100" and 10, it says "100" > 10
>
> For "100" and "abc", it says "100" < abc
>
> For "abc" and "10", it says "abc" < 10
>
> This is correct, if you look at each decision. But that leads to:
>
> 100 < abc < 10
>
> and
>
> 10 < 100
>
> Solaris' qsort does not like that. We cannot change
> compare_function, because that would break thousands of scripts.
> rsort() should not use qsort.
All *sort() functions that use compare_function() should not use
qsort(). I'll change them to use mergesort() instead.
-Andrei
"Everything should be made as simple
as possible, but not simpler."
-- Albert Einstein