Bug #17307 Updated: sorting using usort() does not produce correct result anymore
| From: | derick@php.net | Date: | Sat, 18 May 2002 12:49:39 +0000 |
| Subject: | Bug #17307 Updated: sorting using usort() does not produce correct result anymore | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7985@lists.php.net to get a copy of this message | ||
ID: 17307
Updated by: derick@php.net
Reported By: fcartegnie@nordnet.fr
-Status: Open
+Status: Feedback
Bug Type: Arrays related
Operating System: Linux
PHP Version: 4.2.1
New Comment:
Please prive a short self containing script (which runs right away
after copy&paste).
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-05-18 08:36:08] fcartegnie@nordnet.fr
I used to make sorts with usort and calling the function below. This
was working on the last versions but not anymore on the 4.2.1 :/ which
outputs strange result.
function sort_function($a, $b)
{
if ((($a["livre"]/$a["quantite"]) ==
($b["livre"]/$b["quantite"])) ||
$a["nom"] != $b["nom"]) return 0;
return (($a["livre"]/$a["quantite"]) <
($b["livre"]/$b["quantite"]))
? -1 : 1;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17307&edit=1