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