convert ***sort builtins to use inout instead of references
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / rsort_variation7.php
blobcd1497076fae2800cbac4f60ee389a814b149bc0
1 <?hh
2 /* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
3 * Description: Sort an array in reverse order
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Pass rsort() arrays of boolean values to test behaviour
9 */
10 <<__EntryPoint>> function main(): void {
11 echo "*** Testing rsort() : variation ***\n";
13 // bool value array
14 $bool_values = array (true, false, TRUE, FALSE);
16 echo "\n-- 'flag' value is defualt --\n";
17 $temp_array = $bool_values;
18 var_dump(rsort(inout $temp_array) );
19 var_dump($temp_array);
21 echo "\n-- 'flag' value is SORT_REGULAR --\n";
22 $temp_array = $bool_values;
23 var_dump(rsort(inout $temp_array, SORT_REGULAR) );
24 var_dump($temp_array);
26 echo "\n-- 'flag' value is SORT_NUMERIC --\n";
27 $temp_array = $bool_values;
28 var_dump(rsort(inout $temp_array, SORT_NUMERIC) );
29 var_dump($temp_array);
31 echo "\n-- 'flag' value is SORT_STRING --\n";
32 $temp_array = $bool_values;
33 var_dump(rsort(inout $temp_array, SORT_STRING) );
34 var_dump($temp_array);
36 echo "Done";