1--TEST-- 2Test unlink() function : usage variations - unlink deleted file 3--FILE-- 4<?php 5 6/* Try deleting a file which is already deleted */ 7 8$file_path = __DIR__; 9 10// temp file used 11$filename = "$file_path/unlink_variation4.tmp"; 12 13echo "*** Testing unlink() on deleted file ***\n"; 14// create temp file 15$fp = fopen($filename, "w"); 16fclose($fp); 17 18// delete temp file 19var_dump( unlink($filename) ); // expected: true 20var_dump( file_exists($filename) ); // confirm file deleted 21 22// delete deleted file 23var_dump( unlink($filename) ); // expected: false 24 25echo "Done\n"; 26?> 27--EXPECTF-- 28*** Testing unlink() on deleted file *** 29bool(true) 30bool(false) 31 32Warning: unlink(%s/unlink_variation4.tmp): %s in %s on line %d 33bool(false) 34Done 35