remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / sort_variation4.php
blob9c2a9b7abc25519620c6cad977405d80abfb06aa
1 <?hh
2 /* Prototype : bool sort ( array &$array [, int $sort_flags] )
3 * Description: This function sorts an array.
4 Elements will be arranged from lowest to highest when this function has completed.
5 * Source code: ext/standard/array.c
6 */
8 /*
9 * Testing sort() by providing reference variable array with following flag values
10 * flag value as defualt
11 * SORT_REGULAR - compare items normally
12 * SORT_NUMERIC - compare items numerically
14 <<__EntryPoint>> function main(): void {
15 echo "*** Testing sort() :usage variations ***\n";
17 $value1 = 100;
18 $value2 = 33;
19 $value3 = 555;
22 $unsorted_numerics = array( $value1 , $value2, $value3);
24 echo "\n-- Testing sort() by supplying reference variable array, 'flag' value is defualt --\n";
25 $temp_array = $unsorted_numerics;
26 var_dump( sort(&$temp_array) ); // expecting : bool(true)
27 var_dump( $temp_array);
29 echo "\n-- Testing sort() by supplying reference variable array, 'flag' = SORT_REGULAR --\n";
30 $temp_array = $unsorted_numerics;
31 var_dump( sort(&$temp_array, SORT_REGULAR) ); // expecting : bool(true)
32 var_dump( $temp_array);
34 echo "\n-- Testing sort() by supplying reference variable array, 'flag' = SORT_NUMERIC --\n";
35 var_dump( sort(&$temp_array, SORT_NUMERIC) ); // expecting : bool(true)
36 var_dump( $temp_array);
38 echo "Done\n";