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