repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
import zend standard tests
[hiphop-php.git]
/
hphp
/
test
/
zend
/
good
/
ext-standard-array
/
uksort_basic.php
blob
dee015a7e4499ba1e803589b402dc2d74bb7d794
1
<
?php
2
/*
3
* proto bool uksort ( array &$array, callback $cmp_function )
4
* Function is implemented in ext/standard/array.c
5
*/
6
function
cmp
(
$a
,
$b
) {
7
if
(
$a
==
$b
) {
8
return
0
;
9
}
10
return
(
$a
<
$b
)
?
-
1
:
1
;
11
}
12
$a
=
array
(
3
,
2
,
5
,
6
,
1
);
13
uasort
(
$a
,
"cmp"
);
14
foreach
(
$a
as
$key
=>
$value
) {
15
echo
"
$key
:
$value\n
"
;
16
}
17
?
>