mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
- Add test
This commit is contained in:
parent
b2565bded0
commit
bb924b320f
1 changed files with 35 additions and 0 deletions
35
ext/unicode/tests/iterator_002.phpt
Executable file
35
ext/unicode/tests/iterator_002.phpt
Executable file
|
@ -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===
|
Loading…
Add table
Add a link
Reference in a new issue