summaryrefslogtreecommitdiff
path: root/ext/unicode/tests/iterator_002.phpt
blob: fc14cab0a492961b429fecbed4b955b6c36c2ff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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===