2 /* Prototype : mixed array_shift(array &$stack)
3 * Description: Pops an element off the beginning of the array
4 * Source code: ext/standard/array.c
8 * Pass arrays with different data types as keys to test how array_shift() re-assigns keys
11 echo "*** Testing array_shift() : usage variations ***\n";
13 //get an unset variable
22 // unexpected values to be passed to $stack argument
34 /*2*/ 'float' => array(
40 /*3*/ 'extreme floats' => array(
41 12.3456789000e10
=> 'large',
42 12.3456789000E-10 => 'small',
46 /*4*/ 'null uppercase' => array(
50 /*5*/ 'null lowercase' => array(
55 /*6*/ 'bool lowercase' => array(
60 /*7*/ 'bool uppercase' => array(
66 /*8*/ 'empty double quotes' => array(
70 /*9*/ 'empty single quotes' => array(
75 /*10*/ 'string' => array(
76 "stringd" => 'stringd',
77 'strings' => 'strings',
78 $heredoc => 'stringh',
82 /*11*/ 'undefined' => array(
83 @$undefined_var => 'undefined',
87 /*12*/ 'unset' => array(
88 @$unset_var => 'unset',
92 // loop through each element of $inputs to check the behavior of array_shift()
94 foreach($inputs as $key => $input) {
95 echo "\n-- Iteration $iterator : $key data --\n";
96 var_dump( array_shift($input) );