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
8 * Pass different data types as $sort_flags argument to rsort() to test behaviour
9 * Where possible, 'SORT_NUMERIC' has been entered as a string value
12 echo "*** Testing rsort() : variation ***\n";
14 // Initialise function arguments not being substituted
15 $array_arg = array (1, 5, 2, 3, 1);
17 //get an unset variable
24 public function __toString() {
25 return "SORT_NUMERIC";
34 // get a resource variable
35 $fp = fopen(__FILE__
, "r");
37 // unexpected values to be passed to $sort_flags argument
68 /*18*/ "SORT_NUMERIC",
76 /*22*/ @$undefined_var,
85 // loop through each element of $inputs to check the behavior of rsort()
87 foreach($inputs as $input) {
88 echo "\n-- Iteration $iterator --\n";
90 //create temporary array in case rsort() works
93 var_dump( rsort($temp, $input) );