1--TEST--
2Test unlink() function : usage variations - unlink file in use
3--FILE--
4<?php
5
6/* Try to unlink file when file handle is still in use */
7
8$file_path = __DIR__;
9
10echo "*** Testing unlink() on a file which is in use ***\n";
11// temp file name used here
12$filename = "$file_path/unlink_variation2.tmp";
13
14// create file
15$fp = fopen($filename, "w");
16// try unlink() on $filename
17var_dump( unlink($filename) );  // expected: true on linux
18var_dump( file_exists($filename) );  // confirm file is deleted
19// now close file handle
20fclose($fp);
21
22echo "Done\n";
23?>
24--EXPECT--
25*** Testing unlink() on a file which is in use ***
26bool(true)
27bool(false)
28Done
29