iterator_058.phpt 467 B

123456789101112131415161718192021222324
  1. --TEST--
  2. SPL: Iterator::__construct(void)
  3. --CREDITS--
  4. Sebastian Schürmann
  5. --FILE--
  6. <?php
  7. class myIterator implements Iterator {
  8. function current(): mixed {}
  9. function next(): void {}
  10. function key(): mixed {}
  11. function valid(): bool {}
  12. function rewind(): void {}
  13. }
  14. try {
  15. $it = new myIterator();
  16. } catch (InvalidArgumentException $e) {
  17. echo 'InvalidArgumentException thrown';
  18. }
  19. echo 'no Exception thrown';
  20. ?>
  21. --EXPECT--
  22. no Exception thrown