Annotation of embedaddon/php/ext/spl/tests/iterator_029.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: RegexIterator
! 3: --FILE--
! 4: <?php
! 5:
! 6: $ar = array(0, "123", 123, 22 => "abc", "a2b", 22, "a2d" => 7, 42);
! 7:
! 8: foreach(new RegexIterator(new ArrayIterator($ar), "/2/") as $k => $v)
! 9: {
! 10: echo "$k=>$v\n";
! 11: }
! 12:
! 13: ?>
! 14: ===KEY===
! 15: <?php
! 16:
! 17: foreach(new RegexIterator(new ArrayIterator($ar), "/2/", 0, RegexIterator::USE_KEY) as $k => $v)
! 18: {
! 19: echo "$k=>$v\n";
! 20: }
! 21:
! 22: ?>
! 23: ===DONE===
! 24: <?php exit(0); ?>
! 25: --EXPECT--
! 26: 1=>123
! 27: 2=>123
! 28: 23=>a2b
! 29: 24=>22
! 30: 25=>42
! 31: ===KEY===
! 32: 2=>123
! 33: 22=>abc
! 34: 23=>a2b
! 35: 24=>22
! 36: a2d=>7
! 37: 25=>42
! 38: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>