2 /* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
3 * Description: Returns a copy of input array padded with pad_value to size pad_size
4 * Source code: ext/standard/array.c
8 * Testing array_pad() function by passing values to $input argument other than arrays
9 * and see that function outputs proper warning messages wherever expected.
10 * The $pad_size and $pad_value arguments passed are fixed values.
13 echo "*** Testing array_pad() : passing non array values to \$input argument ***\n";
15 // Initialise $pad_size and $pad_value
19 //get an unset variable
26 public function __toString() {
27 return "Class A object";
36 // get a resource variable
37 $fp = fopen(__FILE__
, "r");
39 // unexpected values to be passed to $input argument
77 /*22*/ @$undefined_var,
86 // loop through each element of $inputs to check the behavior of array_pad()
88 foreach($inputs as $input) {
89 echo "\n-- Iteration $iterator --";
90 var_dump( array_pad($input, $pad_size, $pad_value) ); // positive 'pad_size'
91 var_dump( array_pad($input, -$pad_size, $pad_value) ); // negative 'pad_size'