1--TEST-- 2Test end() function : usage variations - Multi-dimensional arrays 3--FILE-- 4<?php 5/* 6 * Test end() when passed: 7 * 1. a two-dimensional array 8 * 2. a sub-array 9 * as $array_arg argument. 10 */ 11 12echo "*** Testing end() : usage variations ***\n"; 13 14$array_arg = array ('a' => 'z', array(9, 8, 7)); 15 16echo "\n-- Pass a two-dimensional array as \$array_arg --\n"; 17var_dump(end($array_arg)); 18 19echo "\n-- Pass a sub-array as \$array_arg --\n"; 20var_dump(end($array_arg[0])); 21?> 22--EXPECT-- 23*** Testing end() : usage variations *** 24 25-- Pass a two-dimensional array as $array_arg -- 26array(3) { 27 [0]=> 28 int(9) 29 [1]=> 30 int(8) 31 [2]=> 32 int(7) 33} 34 35-- Pass a sub-array as $array_arg -- 36int(7) 37