xref: /PHP-7.2/ext/spl/tests/fixedarray_019.phpt (revision f60da355)
1--TEST--
2SPL: FixedArray: overriden iterator methods
3--FILE--
4<?php
5class SplFixedArray2 extends SplFixedArray {
6    public function rewind() {
7        echo "rewind\n";
8        return parent::rewind();
9    }
10    public function valid() {
11        echo "valid\n";
12        return parent::valid();
13    }
14    public function next() {
15        echo "next\n";
16        return parent::next();
17    }
18    public function current() {
19        echo "current\n";
20        return parent::current();
21    }
22    public function key() {
23        echo "key\n";
24        return parent::key();
25    }
26}
27
28$fa = new SplFixedArray2(3);
29foreach($fa as $k=>$v) {
30    echo "$k=>";
31    var_dump($v);
32}
33?>
34--EXPECT--
35rewind
36valid
37current
38key
390=>NULL
40next
41valid
42current
43key
441=>NULL
45next
46valid
47current
48key
492=>NULL
50next
51valid
52