bug78189.phpt 790 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Bug #78189 (file cache strips last character of uname hash)
  3. --EXTENSIONS--
  4. opcache
  5. --SKIPIF--
  6. <?php
  7. if (substr(PHP_OS, 0, 3) !== 'WIN') die('skip this test is for Windows platforms only');
  8. ?>
  9. --INI--
  10. opcache.enable_cli=1
  11. opcache.optimization_level=-1
  12. opcache.file_cache="{TMP}"
  13. opcache.file_cache_only=1
  14. opcache.jit=0
  15. --FILE--
  16. <?php
  17. $tmpdir = sys_get_temp_dir();
  18. $pattern = $tmpdir . '/*/*/' . str_replace(':', '', __DIR__) . '/bug78189.php.bin';
  19. $filenames = glob($pattern);
  20. if (count($filenames)) {
  21. foreach ($filenames as $filename) {
  22. $part = substr($filename, strlen($tmpdir), 34);
  23. if (!preg_match('~/[0-9a-f]{32}/~', $part)) {
  24. echo "invalid opcache folder: $part\n";
  25. }
  26. }
  27. } else {
  28. echo "no opcache file found!\n";
  29. }
  30. ?>
  31. --EXPECT--