Hi,
In the latest CVS, usort gives strange results: if I use the example from
the manual,
function cmp ($a, $b) {
if ($a == $b) return 0;
return ($a < $b) ? -1 : 1;
}
$a = array (3, 2, 5, 6, 1);
usort ($a, "cmp");
while (list ($key, $value) = each ($a)) {
echo "$key: $value\n";
}
I would expect to get
0: 1
1: 2
2: 3
3: 5
4: 6
This still works on 407RC3
However, on the latest CVS I get:
4: 1
1: 2
0: 3
2: 5
3: 6
So it seems the results are sorted, but the keys aren't reassigned...
Cheerio, Marc.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]