blob: eeae6ba3b6cc914f1f2d626d097119442cc498bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
--TEST--
Test uksort(): basic functionality
--FILE--
<?php
/*
* Function is implemented in ext/standard/array.c
*/
function cmp($a, $b) {
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
}
$a = array(3, 2, 5, 6, 1);
uasort($a, "cmp");
foreach($a as $key => $value) {
echo "$key: $value\n";
}
?>
--EXPECT--
4: 1
1: 2
0: 3
2: 5
3: 6
|