TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
404 B

--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;
}
function main()
{
$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