1--TEST--
2array_pad() tests
3--FILE--
4<?php
5
6var_dump(array_pad());
7var_dump(array_pad(array()));
8var_dump(array_pad(array(), 1));
9var_dump(array_pad(array(), 1, 0));
10
11var_dump(array_pad(array(), 0, 0));
12var_dump(array_pad(array(), -1, 0));
13var_dump(array_pad(array("", -1, 2.0), 5, 0));
14var_dump(array_pad(array("", -1, 2.0), 5, array()));
15var_dump(array_pad(array("", -1, 2.0), 2, array()));
16var_dump(array_pad(array("", -1, 2.0), -3, array()));
17var_dump(array_pad(array("", -1, 2.0), -4, array()));
18var_dump(array_pad(array("", -1, 2.0), 2000000, 0));
19var_dump(array_pad("", 2000000, 0));
20
21echo "Done\n";
22?>
23--EXPECTF--
24Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
25NULL
26
27Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
28NULL
29
30Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
31NULL
32array(1) {
33  [0]=>
34  int(0)
35}
36array(0) {
37}
38array(1) {
39  [0]=>
40  int(0)
41}
42array(5) {
43  [0]=>
44  string(0) ""
45  [1]=>
46  int(-1)
47  [2]=>
48  float(2)
49  [3]=>
50  int(0)
51  [4]=>
52  int(0)
53}
54array(5) {
55  [0]=>
56  string(0) ""
57  [1]=>
58  int(-1)
59  [2]=>
60  float(2)
61  [3]=>
62  array(0) {
63  }
64  [4]=>
65  array(0) {
66  }
67}
68array(3) {
69  [0]=>
70  string(0) ""
71  [1]=>
72  int(-1)
73  [2]=>
74  float(2)
75}
76array(3) {
77  [0]=>
78  string(0) ""
79  [1]=>
80  int(-1)
81  [2]=>
82  float(2)
83}
84array(4) {
85  [0]=>
86  array(0) {
87  }
88  [1]=>
89  string(0) ""
90  [2]=>
91  int(-1)
92  [3]=>
93  float(2)
94}
95
96Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d
97bool(false)
98
99Warning: array_pad() expects parameter 1 to be array, string given in %s on line %d
100NULL
101Done
102