touch_variation2.phpt 393 B

123456789101112131415161718192021222324
  1. --TEST--
  2. touch() - ensure touch does not delete existing file.
  3. --CREDITS--
  4. Dave Kelsey <d_kelsey@uk.ibm.com>
  5. --FILE--
  6. <?php
  7. $filename = __DIR__."/touch_variation2.dat";
  8. $fp=fopen($filename,"w");
  9. fwrite ($fp,"mydata");
  10. fclose($fp);
  11. var_dump(touch($filename, 101));
  12. var_dump(file_get_contents($filename));
  13. @unlink($filename);
  14. echo "Done\n";
  15. ?>
  16. --EXPECT--
  17. bool(true)
  18. string(6) "mydata"
  19. Done