1--TEST-- 2Test key() function : basic functionality 3--FILE-- 4<?php 5/* 6 * Test basic functionality of key() 7 */ 8 9echo "*** Testing key() : basic functionality ***\n"; 10 11$array = array ('zero', 99 => 'one', 'two', 'three' => 3); 12echo "\n-- Initial Position: --\n"; 13var_dump(key($array)); 14 15echo "\n-- Next Position: --\n"; 16next($array); 17var_dump(key($array)); 18 19echo "\n-- End Position: --\n"; 20end($array); 21var_dump(key($array)); 22 23echo "\n-- Past end of the array --\n"; 24next($array); 25var_dump(key($array)); 26?> 27--EXPECT-- 28*** Testing key() : basic functionality *** 29 30-- Initial Position: -- 31int(0) 32 33-- Next Position: -- 34int(99) 35 36-- End Position: -- 37string(5) "three" 38 39-- Past end of the array -- 40NULL 41