2 /* Prototype : string str_pad ( string $input , int $pad_length [, string $pad_string [, int $pad_type ]] )
3 * Description: Pad a string to a certain length with another string
4 * Source code: ext/standard/string.c
7 /* Test str_pad() function: with unexpected inputs for '$input'
8 * and expected type for '$pad_length'
11 echo "*** Testing str_pad() function: with unexpected inputs for 'input' argument ***\n";
13 //get an unset variable
14 $unset_var = 'string_val';
19 public function __toString() {
20 return "sample object";
24 //getting the resource
25 $file_handle = fopen(__FILE__
, "r");
27 // array with different values for $input
64 /*20*/ @$undefined_var,
70 //defining '$pad_length' argument
73 // loop through with each element of the $inputs array to test str_pad() function
75 foreach($inputs as $input) {
76 echo "-- Iteration $count --\n";
77 var_dump( str_pad($input, $pad_length) );
81 fclose($file_handle); //closing the file handle