1--TEST--
2Test array_fill() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing array_fill() : basic functionality ***\n";
6
7// calling the array_fill with all possible valid values for 'val' argument
8$start_key = 0 ;
9$num = 2;
10$heredoc = <<<HERE_DOC
11Hello
12HERE_DOC;
13
14// array of possible valid values for 'val' argument
15$values = array (
16
17  /* 1  */  NULL,
18            0,
19            1,
20  /* 4  */  1.5,
21            'hi',
22            "hi",
23  /* 7  */  $heredoc
24
25);
26
27$counter = 1;
28for($i = 0; $i < count($values); $i ++)
29{
30  echo "-- Iteration $counter --\n";
31  $val = $values[$i];
32
33  var_dump( array_fill($start_key,$num,$val) );
34
35  $counter++;
36}
37
38echo "Done";
39?>
40--EXPECT--
41*** Testing array_fill() : basic functionality ***
42-- Iteration 1 --
43array(2) {
44  [0]=>
45  NULL
46  [1]=>
47  NULL
48}
49-- Iteration 2 --
50array(2) {
51  [0]=>
52  int(0)
53  [1]=>
54  int(0)
55}
56-- Iteration 3 --
57array(2) {
58  [0]=>
59  int(1)
60  [1]=>
61  int(1)
62}
63-- Iteration 4 --
64array(2) {
65  [0]=>
66  float(1.5)
67  [1]=>
68  float(1.5)
69}
70-- Iteration 5 --
71array(2) {
72  [0]=>
73  string(2) "hi"
74  [1]=>
75  string(2) "hi"
76}
77-- Iteration 6 --
78array(2) {
79  [0]=>
80  string(2) "hi"
81  [1]=>
82  string(2) "hi"
83}
84-- Iteration 7 --
85array(2) {
86  [0]=>
87  string(5) "Hello"
88  [1]=>
89  string(5) "Hello"
90}
91Done
92