import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / rsort_variation4.php
blobbfa40c34e430003fa26e12ee19a68a266b11fd32
1 <?php
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 * Test behaviour of rsort() when:
9 * 1. passed an array of referenced variables
10 * 2. $array_arg is a reference to another array
11 * 3. $array_arg is passed by reference
14 echo "*** Testing rsort() : variation ***\n";
16 $value1 = 100;
17 $value2 = 33;
18 $value3 = 555;
20 // an array containing integer references
21 $unsorted_numerics = array( &$value1 , &$value2, &$value3);
23 echo "\n-- 'flag' value is defualt --\n";
24 $temp_array = $unsorted_numerics;
25 var_dump( rsort($temp_array) );
26 var_dump( $temp_array);
28 echo "\n-- 'flag' = SORT_REGULAR --\n";
29 $temp_array = &$unsorted_numerics;
30 var_dump( rsort($temp_array, SORT_REGULAR) );
31 var_dump( $temp_array);
33 echo "Done";