import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / uksort_basic.php
blobdee015a7e4499ba1e803589b402dc2d74bb7d794
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;
10 return ($a < $b) ? -1 : 1;
12 $a = array(3, 2, 5, 6, 1);
13 uasort($a, "cmp");
14 foreach($a as $key => $value) {
15 echo "$key: $value\n";