1--TEST-- 2Test unlink() function : variation 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--FILE-- 6<?php 7echo "*** Testing unlink() : variation: contexts and relative files ***\n"; 8 9// test relative directories and stream contexts. 10$subdir = 'subdir'; 11$testfile = $subdir.'/testfile.txt'; 12mkdir($subdir); 13touch($testfile); 14f_exists($testfile); 15$context = stream_context_create(); 16var_dump(unlink($testfile, $context)); 17f_exists($testfile); 18rmdir($subdir); 19 20function f_exists($file) { 21 if (file_exists($file) == true) { 22 echo "$file exists\n"; 23 } 24 else { 25 echo "$file doesn't exist\n"; 26 } 27} 28?> 29--EXPECT-- 30*** Testing unlink() : variation: contexts and relative files *** 31subdir/testfile.txt exists 32bool(true) 33subdir/testfile.txt doesn't exist 34