Annotation of embedaddon/php/ext/spl/tests/array_020.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: ArrayIterator overloading
! 3: --FILE--
! 4: <?php
! 5:
! 6: class ArrayIteratorEx extends ArrayIterator
! 7: {
! 8: function rewind()
! 9: {
! 10: echo __METHOD__ . "\n";
! 11: ArrayIterator::rewind();
! 12: }
! 13:
! 14: function valid()
! 15: {
! 16: echo __METHOD__ . "\n";
! 17: return ArrayIterator::valid();
! 18: }
! 19:
! 20: function key()
! 21: {
! 22: echo __METHOD__ . "\n";
! 23: return ArrayIterator::key();
! 24: }
! 25:
! 26: function current()
! 27: {
! 28: echo __METHOD__ . "\n";
! 29: return ArrayIterator::current();
! 30: }
! 31:
! 32: function next()
! 33: {
! 34: echo __METHOD__ . "\n";
! 35: return ArrayIterator::next();
! 36: }
! 37: }
! 38:
! 39: $ar = new ArrayIteratorEx(array(1,2));
! 40: foreach($ar as $k => $v)
! 41: {
! 42: var_dump($k);
! 43: var_dump($v);
! 44: }
! 45:
! 46: ?>
! 47: ===DONE===
! 48: <?php exit(0); ?>
! 49: --EXPECTF--
! 50: ArrayIteratorEx::rewind
! 51: ArrayIteratorEx::valid
! 52: ArrayIteratorEx::current
! 53: ArrayIteratorEx::key
! 54: int(0)
! 55: int(1)
! 56: ArrayIteratorEx::next
! 57: ArrayIteratorEx::valid
! 58: ArrayIteratorEx::current
! 59: ArrayIteratorEx::key
! 60: int(1)
! 61: int(2)
! 62: ArrayIteratorEx::next
! 63: ArrayIteratorEx::valid
! 64: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>