1--TEST--
2Test array_shift() function : usage variations - position of internal pointer
3--FILE--
4<?php
5/* Prototype  : mixed array_shift(array &$stack)
6 * Description: Pops an element off the beginning of the array
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Test that the internal pointer is reset after calling array_shift()
12 */
13
14echo "*** Testing array_shift() : usage variations ***\n";
15
16$stack = array ('one' => 'un', 'two' => 'deux');
17
18echo "\n-- Call array_shift() --\n";
19var_dump($result = array_shift($stack));
20
21echo "\n-- Position of Internal Pointer in Passed Array: --\n";
22echo key($stack) . " => " . current ($stack) . "\n";
23
24echo "Done";
25?>
26--EXPECTF--
27*** Testing array_shift() : usage variations ***
28
29-- Call array_shift() --
30string(2) "un"
31
32-- Position of Internal Pointer in Passed Array: --
33two => deux
34Done