dit_005.phpt 433 B

123456789101112131415161718192021
  1. --TEST--
  2. SPL: FilesystemIterator and clone
  3. --FILE--
  4. <?php
  5. // Let's hope nobody writes into this directory while testing...
  6. $a = new FileSystemIterator(__DIR__ . '/..');
  7. $b = clone $a;
  8. var_dump((string)$b == (string)$a);
  9. var_dump($a->key() == $b->key());
  10. $a->next();
  11. $a->next();
  12. $a->next();
  13. $c = clone $a;
  14. var_dump((string)$c == (string)$a);
  15. var_dump($a->key() == $c->key());
  16. ?>
  17. --EXPECT--
  18. bool(true)
  19. bool(true)
  20. bool(true)
  21. bool(true)