iterator_count.phpt 445 B

1234567891011121314151617181920
  1. --TEST--
  2. SPL: iterator_count() exceptions test
  3. --CREDITS--
  4. Lance Kesson jac_kesson@hotmail.com
  5. #testfest London 2009-05-09
  6. --FILE--
  7. <?php
  8. $array=array('a','b');
  9. $iterator = new ArrayIterator($array);
  10. iterator_count('1');
  11. ?>
  12. --EXPECTF--
  13. Fatal error: Uncaught TypeError: iterator_count(): Argument #1 ($iterator) must be of type Traversable, string given in %s:%d
  14. Stack trace:
  15. #0 %s(%d): iterator_count('1')
  16. #1 {main}
  17. thrown in %s on line %d