Lines Matching refs:fwrite
2 Test fwrite() function : error conditions
6 Prototype: int fwrite ( resource $handle,string string, [, int $length] );
7 Description: fwrite() writes the contents of string to the file stream pointed to by handle.
10 fwrite() returns the number of bytes written or FALSE on error
16 echo "*** Testing fwrite() : error conditions ***\n";
20 echo "-- Testing fwrite() with less than expected number of arguments --\n";
22 var_dump( fwrite() );
25 var_dump( fwrite($file_handle) );
28 echo "-- Testing fwrite() with more than expected number of arguments --\n";
30 var_dump( fwrite($file_handle, $data, strlen($data), 10) );
33 echo "-- Testing fwrite() with invalid length arguments --\n";
35 var_dump( fwrite($file_handle, $data, $len) );
37 var_dump( fwrite($file_handle, $data, $len) );
40 echo "-- Testing fwrite() with invalid arguments --\n";
49 /* loop to test fwrite() with different invalid type of args */
52 var_dump( fwrite($invalid_args[$loop_counter - 1], 10) );
55 // fwrite() on a file handle which is already closed
56 echo "-- Testing fwrite() with closed/unset file handle --\n";
58 var_dump(fwrite($file_handle,"data"));
60 // fwrite on a file handle which is unset
63 var_dump( fwrite(@$fp,"data"));
73 *** Testing fwrite() : error conditions ***
74 -- Testing fwrite() with less than expected number of arguments --
76 Warning: fwrite() expects at least 2 parameters, 0 given in %s on line %d
79 Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d
81 -- Testing fwrite() with more than expected number of arguments --
83 Warning: fwrite() expects at most 3 parameters, 4 given in %s on line %d
85 -- Testing fwrite() with invalid length arguments --
88 -- Testing fwrite() with invalid arguments --
91 Warning: fwrite() expects parameter 1 to be resource, string given in %s on line %d
95 Warning: fwrite() expects parameter 1 to be resource, integer given in %s on line %d
99 Warning: fwrite() expects parameter 1 to be resource, double given in %s on line %d
103 Warning: fwrite() expects parameter 1 to be resource, boolean given in %s on line %d
107 Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d
111 Warning: fwrite() expects parameter 1 to be resource, object given in %s on line %d
113 -- Testing fwrite() with closed/unset file handle --
115 Warning: fwrite(): %d is not a valid stream resource in %s on line %d
118 Warning: fwrite() expects parameter 1 to be resource, null given in %s on line %d