bug41518.phpt 649 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #41518 (file_exists() warns of open_basedir restriction on non-existent file)
  3. --SKIPIF--
  4. <?php
  5. $tmp_dir = __DIR__ . '/bug41518';
  6. mkdir($tmp_dir);
  7. if (!is_dir($tmp_dir)) {
  8. die("skip");
  9. }
  10. @unlink($tmp_dir);
  11. ?>
  12. --INI--
  13. open_basedir=.
  14. --FILE--
  15. <?php
  16. $tmp_dir = __DIR__ . "/bug41518/";
  17. @mkdir($tmp_dir);
  18. $tmp_file = $tmp_dir."/bug41418.tmp";
  19. touch($tmp_file);
  20. var_dump(file_exists($tmp_file)); //exists
  21. var_dump(file_exists($tmp_file."nosuchfile")); //doesn't exist
  22. @unlink($tmp_file);
  23. @rmdir($tmp_dir);
  24. echo "Done\n";
  25. ?>
  26. --CLEAN--
  27. <?php
  28. $tmp_dir = __DIR__ . "/bug41518/";
  29. @unlink($tmp_dir);
  30. ?>
  31. --EXPECT--
  32. bool(true)
  33. bool(false)
  34. Done