note 88887 added to function.uksort
| From: | dead dot screamer at seznam dot cz | Date: | Thu, 12 Feb 2009 08:49:40 +0000 |
| Subject: | note 88887 added to function.uksort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150559@lists.php.net to get a copy of this message | ||
user sorting functions are working very odd and unpredictably, when compare function return 0.
In this situation is array sorted randomly.
example:
<?php
$array=range(1,10);
var_Dump($array);
uKSort($array,create_Function('$a, $b','return 0;'));
var_Dump($array);
?>
output:
array(10) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
[5]=>
int(6)
[6]=>
int(7)
[7]=>
int(8)
[8]=>
int(9)
[9]=>
int(10)
}
array(10) {
[6]=>
int(7)
[7]=>
int(8)
[8]=>
int(9)
[9]=>
int(10)
[5]=>
int(6)
[4]=>
int(5)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[0]=>
int(1)
}
----
Server IP: 147.32.160.17
Probable Submitter: 82.142.89.49
----
Manual Page -- http://www.php.net/manual/en/function.uksort.php
Edit -- https://master.php.net/note/edit/88887
Del: integrated -- https://master.php.net/note/delete/88887/integrated
Del: useless -- https://master.php.net/note/delete/88887/useless
Del: bad code -- https://master.php.net/note/delete/88887/bad+code
Del: spam -- https://master.php.net/note/delete/88887/spam
Del: non-english -- https://master.php.net/note/delete/88887/non-english
Del: in docs -- https://master.php.net/note/delete/88887/in+docs
Del: other reasons-- https://master.php.net/note/delete/88887
Reject -- https://master.php.net/note/reject/88887
Search -- https://master.php.net/manage/user-notes.php