2 /* Prototype : 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 values for 'val' argument
11 echo "*** Testing array_fill() : usage variations ***\n";
13 // Initialise function arguments not being substituted
17 //get an unset variable
32 //array of different values for 'val' argument
47 // loop through each element of the array for 'val' argument
48 // check the working of array_fill()
49 echo "--- Testing array_fill() with different values for 'val' argument ---\n";
51 for($index = 0; $index < count($values); $index ++
)
53 echo "-- Iteration $counter --\n";
54 $val = $values[$index];
56 var_dump( array_fill($start_key , $num , $val) );