Bug #18050 Updated: asort not sorting properly
| From: | rasmus@php.net | Date: | Fri, 28 Jun 2002 18:37:09 +0000 |
| Subject: | Bug #18050 Updated: asort not sorting properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12436@lists.php.net to get a copy of this message | ||
ID: 18050
Updated by: rasmus@php.net
Reported By: bstoppel@ku.edu
-Status: Open
+Status: Feedback
Bug Type: Arrays related
Operating System: Digital UNIX V4.0F (Rev. 1229)
PHP Version: 4.2.1
New Comment:
Hrm.. On my Linux box your script outputs:
c = apple
b = banana
d = lemon
a = orange
Are you on a 64-bit platform? I'm looking at the zend_qsort() function
but I don't see an obvious mistake.
Previous Comments:
------------------------------------------------------------------------
[2002-06-28 14:28:17] bstoppel@ku.edu
I used the example given in the asort documentation. The result is not
correct. Here is the example for your convenience:
$fruits = array ("d"=>"lemon", "a"=>"orange",
"b"=>"banana",
"c"=>"apple");
asort ($fruits);
reset ($fruits);
while (list ($key, $val) = each ($fruits)) {
echo "$key = $val\n";
}
The actual output is
d = lemon
a = orange
b = banana
c = apple
The expected output is
c = apple
b = banana
d = lemon
a = orange
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18050&edit=1