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