bug39367.phpt 637 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Bug #39367 (clearstatcache() doesn't clear realpath cache)
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) == 'WIN') {
  6. die('skip not for Windows');
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. function test() {
  12. unlink('/tmp/1link');
  13. unlink('/tmp/1tmp');
  14. unlink('/tmp/testfile1');
  15. file_put_contents('/tmp/testfile1', 'ok');
  16. symlink('/tmp/testfile1', '/tmp/1tmp');
  17. rename('/tmp/1tmp', '/tmp/1link');
  18. echo file_get_contents('/tmp/1link')."\n";
  19. unlink('/tmp/1link');
  20. clearstatcache(true);
  21. echo file_get_contents('/tmp/1link')."\n";
  22. unlink('/tmp/1link');
  23. unlink('/tmp/1tmp');
  24. unlink('/tmp/testfile1');
  25. }
  26. @test();
  27. ?>
  28. --EXPECT--
  29. ok