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