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 where values are of one data type to test behaviour of array_shift()
11 echo "*** Testing array_shift() : usage variations ***\n";
14 //get an unset variable
21 public function __toString() {
22 return "Class A object";
31 // get a resource variable
32 $fp = fopen(__FILE__
, "r");
34 // arrays of different data types to be passed to $stack argument
46 /*2*/ 'float' => array(
55 /*3*/ 'null' => array(
61 /*4*/ 'bool' => array(
69 /*5*/ 'empty string' => array(
74 /*6*/ 'empty array' => array(
78 /*7*/ 'string' => array(
85 /*8*/ 'object' => array(
90 /*9*/ 'undefined' => array(
95 /*10*/ 'unset' => array(
100 /*11*/ 'resource' => array(
105 // loop through each element of $inputs to check the behavior of array_shift
107 foreach($inputs as $key => $input) {
108 echo "\n-- Iteration $iterator: $key data --\n";
109 var_dump( array_shift($input) );