xref: /PHP-7.4/ext/spl/tests/iterator_009.phpt (revision 610c7fbe)
1--TEST--
2SPL: EmptyIterator
3--FILE--
4<?php
5
6class EmptyIteratorEx extends EmptyIterator
7{
8	function rewind()
9	{
10		echo __METHOD__ . "\n";
11		parent::rewind();
12	}
13	function valid()
14	{
15		echo __METHOD__ . "\n";
16		return parent::valid();
17	}
18	function current()
19	{
20		echo __METHOD__ . "\n";
21		return parent::current();
22	}
23	function key()
24	{
25		echo __METHOD__ . "\n";
26		return parent::key();
27	}
28	function next()
29	{
30		echo __METHOD__ . "\n";
31		parent::next();
32	}
33}
34
35foreach (new EmptyIteratorEx() as $v) {
36	var_dump($v);
37}
38
39?>
40===DONE===
41<?php exit(0); ?>
42--EXPECT--
43EmptyIteratorEx::rewind
44EmptyIteratorEx::valid
45===DONE===
46