php-src/ext/unicode/tests/iterator_002.phpt
Marcus Boerger bb924b320f - Add test
2006-02-18 17:13:39 +00:00

36 lines
490 B
PHP
Executable File

--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===