1--TEST-- 2Test array_reverse() function : basic functionality - simple array for 'array' argument 3--FILE-- 4<?php 5/* 6 * Testing array_reverse() by giving a simple array for $array argument 7*/ 8 9echo "*** Testing array_reverse() : basic functionality ***\n"; 10 11// Initialise the array 12$array = array("a", "green", "red", 'blue', 10, 13.33); 13 14// Calling array_reverse() with default arguments 15var_dump( array_reverse($array) ); 16 17// Calling array_reverse() with all possible arguments 18var_dump( array_reverse($array, true) ); // expects the keys to be preserved 19var_dump( array_reverse($array, false) ); // expects the keys not to be preserved 20 21echo "Done"; 22?> 23--EXPECT-- 24*** Testing array_reverse() : basic functionality *** 25array(6) { 26 [0]=> 27 float(13.33) 28 [1]=> 29 int(10) 30 [2]=> 31 string(4) "blue" 32 [3]=> 33 string(3) "red" 34 [4]=> 35 string(5) "green" 36 [5]=> 37 string(1) "a" 38} 39array(6) { 40 [5]=> 41 float(13.33) 42 [4]=> 43 int(10) 44 [3]=> 45 string(4) "blue" 46 [2]=> 47 string(3) "red" 48 [1]=> 49 string(5) "green" 50 [0]=> 51 string(1) "a" 52} 53array(6) { 54 [0]=> 55 float(13.33) 56 [1]=> 57 int(10) 58 [2]=> 59 string(4) "blue" 60 [3]=> 61 string(3) "red" 62 [4]=> 63 string(5) "green" 64 [5]=> 65 string(1) "a" 66} 67Done 68