Lines Matching refs:readfile

2 Test readfile() function: error conditions
5 /* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
11 echo "*** Test readfile(): error conditions ***\n";
12 echo "-- Testing readfile() with unexpected no. of arguments --\n";
13 var_dump( readfile() ); // args < expected
14 var_dump( readfile(__FILE__, true, $context, 4) ); // args > expected
16 echo "\n-- Testing readfile() with invalid arguments --\n";
18 var_dump( readfile(NULL) ); // NULL as $filename
19 var_dump( readfile('') ); // empty string as $filename
20 var_dump( readfile(false) ); // boolean false as $filename
21 var_dump( readfile(__FILE__, false, '') ); // empty string as $context
22 var_dump( readfile(__FILE__, true, false) ); // boolean false as $context
24 echo "\n-- Testing readfile() with non-existent file --\n";
26 var_dump( readfile($non_existent_file) );
31 *** Test readfile(): error conditions ***
32 -- Testing readfile() with unexpected no. of arguments --
34 Warning: readfile() expects at least 1 parameter, 0 given in %s on line %d
37 Warning: readfile() expects at most 3 parameters, 4 given in %s on line %d
40 -- Testing readfile() with invalid arguments --
42 Warning: readfile(): Filename cannot be empty in %s on line %d
45 Warning: readfile(): Filename cannot be empty in %s on line %d
48 Warning: readfile(): Filename cannot be empty in %s on line %d
51 Warning: readfile() expects parameter 3 to be resource, string given in %s on line %d
54 Warning: readfile() expects parameter 3 to be resource, bool given in %s on line %d
57 -- Testing readfile() with non-existent file --
59 Warning: readfile(%s/non_existent_file.tmp): failed to open stream: %s in %s on line %d