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