2 /* Prototype : proto array array_fill(int start_key, int num, mixed val)
3 * Description: Create an array containing num elements starting with index start_key each initialized to val
4 * Source code: ext/standard/array.c
8 * testing array_fill() by passing different unexpected value for 'start_key' argument
11 echo "*** Testing array_fill() : usage variations ***\n";
13 // Initialise function arguments not being substituted
17 //get an unset variable
21 //get a resource variable
22 $fp = fopen(__FILE__
, "r");
35 //array of different values for 'start_key' argument
50 array('color' => 'red', 'item' => 'pen'),
83 // loop through each element of the array for start_key
84 // check the working of array_fill()
85 echo "--- Testing array_fill() with different values for 'start_key' arg ---\n";
87 for($index = 0; $index < count($values); $index ++
)
89 echo "-- Iteration $counter --\n";
90 $start_key = $values[$index];
92 var_dump( array_fill($start_key,$num,$val) );
97 // close the resource used