bug42364.phpt 590 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #42364 (Crash when using getRealPath with DirectoryIterator)
  3. --FILE--
  4. <?php
  5. $dir = __DIR__ . '/bug42364';
  6. @mkdir($dir);
  7. touch($dir . '/test');
  8. $count = 0;
  9. $it = new DirectoryIterator($dir);
  10. foreach ($it as $e) {
  11. $count++;
  12. $type = gettype($e->getRealPath());
  13. if ($type != "string" && $type != "unicode") {
  14. echo $e->getFilename(), " is a ", gettype($e->getRealPath()), "\n";
  15. }
  16. }
  17. if ($count > 0) {
  18. echo "Found $count entries!\n";
  19. }
  20. ?>
  21. --CLEAN--
  22. <?php
  23. unlink(__DIR__ . '/bug42364/test');
  24. rmdir(__DIR__ . '/bug42364');
  25. ?>
  26. --EXPECTF--
  27. Found %i entries!