// arguments less than expected numbers
var_dump( ftruncate( $file_handle ) );
// check the first size
-clearstatcache();
var_dump( filesize($filename) );
echo "-- Testing ftruncate() with more than expected number of arguments --\n";
// more than expected number of arguments
var_dump( ftruncate($file_handle, 10, 20) );
-// check the first size
-clearstatcache();
+// check the first size
var_dump( filesize($filename) );
// test invalid arguments : non-resources
// ftruncate on close file handle
fclose($file_handle);
var_dump( ftruncate($file_handle,10) );
-// check the first size
-clearstatcache();
+// check the first size
var_dump( filesize($filename) );
// ftruncate on a file handle which is unset
$fp = fopen($filename, "w");
unset($fp); //unset file handle
var_dump( ftruncate(@$fp,10));
-// check the first size
-clearstatcache();
+// check the first size
var_dump( filesize($filename) );
echo "Done\n";
Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d
bool(false)
-int(0)
+int(36)
Done