1--TEST-- 2Test end() function : basic functionality 3--FILE-- 4<?php 5/* 6 * Test basic functionality of end() 7 */ 8 9echo "*** Testing end() : basic functionality ***\n"; 10 11$array = array('zero', 'one', 200 => 'two'); 12 13echo "\n-- Initial Position: --\n"; 14echo key($array) . " => " . current($array) . "\n"; 15 16echo "\n-- Call to end() --\n"; 17var_dump(end($array)); 18 19echo "\n-- Current Position: --\n"; 20echo key($array) . " => " . current($array) . "\n"; 21 22echo "\n-- Add a new element to array --\n"; 23$array[2] = 'foo'; 24var_dump(end($array)); 25?> 26--EXPECT-- 27*** Testing end() : basic functionality *** 28 29-- Initial Position: -- 300 => zero 31 32-- Call to end() -- 33string(3) "two" 34 35-- Current Position: -- 36200 => two 37 38-- Add a new element to array -- 39string(3) "foo" 40