xref: /PHP-8.0/ext/spl/tests/iterator_009.phpt (revision f8d79582)
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--EXPECT--
41EmptyIteratorEx::rewind
42EmptyIteratorEx::valid
43