]> granicus.if.org Git - php/commitdiff
Unicode support
authorDmitry Stogov <dmitry@php.net>
Mon, 19 Sep 2005 07:49:13 +0000 (07:49 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 19 Sep 2005 07:49:13 +0000 (07:49 +0000)
ext/spl/spl_array.c
ext/spl/tests/iterator_024.phpt
ext/spl/tests/iterator_027.phpt

index 952f54734666085d38d766730e312f10bf49dfb3..b954b225692f0d9fb6df2d01b71a56e17f15942a 100755 (executable)
@@ -179,7 +179,7 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s
                        intern->fptr_offset_del = NULL;
                }
        }
-       intern->ce_get_iterator = spl_ce_ArrayIterator;
+       intern->ce_get_iterator = U_CLASS_ENTRY(spl_ce_ArrayIterator);
        zend_hash_internal_pointer_reset_ex(spl_array_get_hash_table(intern, 0 TSRMLS_CC), &intern->pos);
        return retval;
 }
@@ -870,7 +870,7 @@ SPL_METHOD(Array, getIteratorClass)
        zval *object = getThis();
        spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
 
-       RETURN_STRING(intern->ce_get_iterator->name, 1);
+       RETURN_TEXTL(intern->ce_get_iterator->name, intern->ce_get_iterator->name_length, 1);
 }
 /* }}} */
 
index 0c7dea15bc04e56fbae70b206026fc9f89831e04..cecf08e7a3e65d20d6fa7273aa7b917602717307 100755 (executable)
@@ -47,3 +47,21 @@ string(22) "RecursiveArrayIterator"
 331
 4
 ===DONE===
+--UEXPECT--
+1
+2
+31
+32
+331
+4
+unicode(13) "ArrayIterator"
+An instance of RecursiveIterator or IteratorAggregate creating it is required
+===MANUAL===
+unicode(22) "RecursiveArrayIterator"
+1
+2
+31
+32
+331
+4
+===DONE===
index fd9ba70c0f2e4305d2a6ec34e41d73ca04cba7b3..3c2f72238522f61fb86821f92846191899ec97d9 100755 (executable)
@@ -81,3 +81,31 @@ bool(false)
 bool(false)
 bool(false)
 ===DONE===
+--UEXPECT--
+0=>1
+1=>2
+0=>31
+1=>32
+0=>331
+3=>4
+===CHECK===
+int(0)
+int(331)
+int(1)
+int(32)
+int(3)
+int(4)
+unicode(3) "foo"
+unicode(3) "bar"
+unicode(2) "25"
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+===REWIND===
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+===DONE===