1--TEST-- 2Test array_shift() function : basic functionality 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 basic functionality of array_shift() 12 */ 13 14echo "*** Testing array_shift() : basic functionality ***\n"; 15 16$array = array('zero', 'one', '3' => 'three', 'four' => 4); 17echo "\n-- Before shift: --\n"; 18var_dump($array); 19 20echo "\n-- After shift: --\n"; 21echo "Returned value:\t"; 22var_dump(array_shift($array)); 23echo "New array:\n"; 24var_dump($array); 25 26echo "Done"; 27?> 28--EXPECTF-- 29*** Testing array_shift() : basic functionality *** 30 31-- Before shift: -- 32array(4) { 33 [0]=> 34 string(4) "zero" 35 [1]=> 36 string(3) "one" 37 [3]=> 38 string(5) "three" 39 ["four"]=> 40 int(4) 41} 42 43-- After shift: -- 44Returned value: string(4) "zero" 45New array: 46array(3) { 47 [0]=> 48 string(3) "one" 49 [1]=> 50 string(5) "three" 51 ["four"]=> 52 int(4) 53} 54Done 55