Bug #18050: asort not sorting properly
| From: | bstoppel at ku dot edu | Date: | Fri, 28 Jun 2002 18:28:18 +0000 |
| Subject: | Bug #18050: asort not sorting properly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-12435@lists.php.net to get a copy of this message | ||
From: bstoppel@ku.edu
Operating system: Digital UNIX V4.0F (Rev. 1229)
PHP version: 4.2.1
PHP Bug Type: Arrays related
Bug description: asort not sorting properly
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 bug report at http://bugs.php.net/?id=18050&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18050&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18050&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18050&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18050&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18050&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18050&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18050&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18050&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18050&r=globals