1--TEST-- 2Test rsort() function : usage variations - referenced variables 3--FILE-- 4<?php 5/* 6 * Test behaviour of rsort() when: 7 * 1. passed an array of referenced variables 8 * 2. $array_arg is a reference to another array 9 * 3. $array_arg is passed by reference 10 */ 11 12echo "*** Testing rsort() : variation ***\n"; 13 14$value1 = 100; 15$value2 = 33; 16$value3 = 555; 17 18// an array containing integer references 19$unsorted_numerics = array( &$value1 , &$value2, &$value3); 20 21echo "\n-- 'flag' value is default --\n"; 22$temp_array = $unsorted_numerics; 23var_dump( rsort($temp_array) ); 24var_dump( $temp_array); 25 26echo "\n-- 'flag' = SORT_REGULAR --\n"; 27$temp_array = &$unsorted_numerics; 28var_dump( rsort($temp_array, SORT_REGULAR) ); 29var_dump( $temp_array); 30 31echo "Done"; 32?> 33--EXPECT-- 34*** Testing rsort() : variation *** 35 36-- 'flag' value is default -- 37bool(true) 38array(3) { 39 [0]=> 40 &int(555) 41 [1]=> 42 &int(100) 43 [2]=> 44 &int(33) 45} 46 47-- 'flag' = SORT_REGULAR -- 48bool(true) 49array(3) { 50 [0]=> 51 &int(555) 52 [1]=> 53 &int(100) 54 [2]=> 55 &int(33) 56} 57Done 58