1--TEST--
2Test reset() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : mixed reset(array $array_arg)
6 * Description: Set array argument's internal pointer to the first element and return it
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Test basic functionality of reset()
12 */
13
14echo "*** Testing reset() : basic functionality ***\n";
15
16$array = array('zero', 'one', 200 => 'two');
17
18echo "\n-- Initial Position: --\n";
19echo key($array) . " => " . current($array) . "\n";
20
21echo "\n-- Call to next() --\n";
22var_dump(next($array));
23
24echo "\n-- Current Position: --\n";
25echo key($array) . " => " . current($array) . "\n";
26
27echo "\n-- Call to reset() --\n";
28var_dump(reset($array));
29?>
30===DONE===
31--EXPECTF--
32*** Testing reset() : basic functionality ***
33
34-- Initial Position: --
350 => zero
36
37-- Call to next() --
38string(3) "one"
39
40-- Current Position: --
411 => one
42
43-- Call to reset() --
44string(4) "zero"
45===DONE===
46