diff options
-rwxr-xr-x | ext/unicode/tests/iterator_002.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/unicode/tests/iterator_002.phpt b/ext/unicode/tests/iterator_002.phpt new file mode 100755 index 0000000000..1e3ce7447e --- /dev/null +++ b/ext/unicode/tests/iterator_002.phpt @@ -0,0 +1,35 @@ +--TEST-- +Unicode: Iterator and key() +--SKIPIF-- +<?php if (!unicode_semantics()) die('skip unicode_semantics=off'); ?> +--FILE-- +<?php + +foreach(new TextIterator("123") as $pos => $char) +{ + var_dump($pos); + var_dump($char); +} + +foreach(new ReverseTextIterator("123") as $pos => $char) +{ + var_dump($pos); + var_dump($char); +} + +?> +===DONE=== +--EXPECTF-- +int(0) +unicode(1) "1" +int(1) +unicode(1) "2" +int(2) +unicode(1) "3" +int(0) +unicode(1) "3" +int(1) +unicode(1) "2" +int(2) +unicode(1) "1" +===DONE=== |