From: Marcus Boerger <helly@php.net> Date: Sat, 18 Feb 2006 17:13:39 +0000 (+0000) Subject: - Add test X-Git-Tag: RELEASE_1_2~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb924b320fce6df1e87f6a10cb3c6805a3b54df5;p=php - Add test --- 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===