1--TEST--
2Test key() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : mixed key(array $array_arg)
6 * Description: Return the key of the element currently pointed to by the internal array pointer
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Test basic functionality of key()
12 */
13
14echo "*** Testing key() : basic functionality ***\n";
15
16$array = array ('zero', 99 => 'one', 'two', 'three' => 3);
17echo "\n-- Initial Position: --\n";
18var_dump(key($array));
19
20echo "\n-- Next Position: --\n";
21next($array);
22var_dump(key($array));
23
24echo "\n-- End Position: --\n";
25end($array);
26var_dump(key($array));
27
28echo "\n-- Past end of the array --\n";
29next($array);
30var_dump(key($array));
31?>
32===DONE===
33--EXPECT--
34*** Testing key() : basic functionality ***
35
36-- Initial Position: --
37int(0)
38
39-- Next Position: --
40int(99)
41
42-- End Position: --
43string(5) "three"
44
45-- Past end of the array --
46NULL
47===DONE===
48