3 Prototype: string fgetc ( resource $handle );
4 Description: Gets character from file pointer
7 echo "*** Testing error conditions ***\n";
9 echo "-- Testing fgetc() with zero argument --\n";
12 // more than expected no. of args
13 echo "-- Testing fgetc() with more than expected number of arguments --\n";
14 $fp = fopen(__FILE__
, "r");
15 var_dump( fgetc($fp, $fp) );
18 // test invalid arguments : non-resources
19 echo "-- Testing fgetc() with invalid arguments --\n";
20 $invalid_args = array (
28 /* loop to test fgetc() with different invalid type of args */
29 for($loop_counter = 1; $loop_counter <= count($invalid_args); $loop_counter++
) {
30 echo "-- Iteration $loop_counter --\n";
31 var_dump( fgetc($invalid_args[$loop_counter - 1]) );