1--TEST--
2Test end() function : usage variations - Multi-dimensional arrays
3--FILE--
4<?php
5/* Prototype  : mixed end(array $array_arg)
6 * Description: Advances array argument's internal pointer to the last element and return it
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Test end() when passed:
12 * 1. a two-dimensional array
13 * 2. a sub-array
14 * as $array_arg argument.
15 */
16
17echo "*** Testing end() : usage variations ***\n";
18
19$array_arg = array ('a' => 'z', array(9, 8, 7));
20
21echo "\n-- Pass a two-dimensional array as \$array_arg --\n";
22var_dump(end($array_arg));
23
24echo "\n-- Pass a sub-array as \$array_arg --\n";
25var_dump(end($array_arg[0]));
26?>
27===DONE===
28--EXPECTF--
29*** Testing end() : usage variations ***
30
31-- Pass a two-dimensional array as $array_arg --
32array(3) {
33  [0]=>
34  int(9)
35  [1]=>
36  int(8)
37  [2]=>
38  int(7)
39}
40
41-- Pass a sub-array as $array_arg --
42int(7)
43===DONE===
44