@ -0,0 +1,20 @@
--TEST--
TextIterator::getAll(): Simple test
--FILE--
<?php
$x = new textiterator('asda');
var_dump($x->getAll());
?>
--EXPECT--
array(4) {
[0]=>
unicode(1) "a"
[1]=>
unicode(1) "s"
[2]=>
unicode(1) "d"
[3]=>
}
@ -0,0 +1,12 @@
TextIterator::next(): Testing with no data
$x = new textiterator;
var_dump($x->next());
--EXPECTF--
Warning: TextIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d
int(-1)
@ -157,6 +157,11 @@ static void text_iter_cp_next(text_iter_obj* object, long flags TSRMLS_DC)
if (object->u.cp.offset == UBRK_DONE) {
return;
if (object->text == NULL) {
object->u.cp.offset = object->u.cp.cp_offset = UBRK_DONE;
if (flags & ITER_REVERSE) {
U16_BACK_1(object->text, 0, object->u.cp.offset);