From: Marcus Boerger Date: Sat, 20 Jan 2007 14:03:59 +0000 (+0000) Subject: - Make use of get_debug_info() handler in ArrayObject/Iterator X-Git-Tag: RELEASE_1_0_0RC1~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6ccbf32fb47173d33cd66ff1a6cf0c4f7482fb4;p=php - Make use of get_debug_info() handler in ArrayObject/Iterator --- diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 57372eadc5..e500171288 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -624,6 +624,60 @@ static HashTable *spl_array_get_properties(zval *object TSRMLS_DC) /* {{{ */ return spl_array_get_hash_table(intern, 1 TSRMLS_CC); } /* }}} */ +static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */ +{ + spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(obj TSRMLS_CC); + HashTable *rv; + zval *tmp, *storage; + int name_len, class_len, prop_len; + zstr zname, zclass, zprop; + + if (HASH_OF(intern->array) == intern->std.properties) { + *is_temp = 0; + return intern->std.properties; + } else { + *is_temp = 1; + + ALLOC_HASHTABLE(rv); + ZEND_INIT_SYMTABLE_EX(rv, zend_hash_num_elements(intern->std.properties) + 1, 0); + + zend_hash_copy(rv, intern->std.properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + + //MAKE_STD_ZVAL(storage); + //array_init(storage); + //spl_instantiate(zend_standard_class_def, &storage, 1 TSRMLS_CC); + //zend_hash_copy(HASH_OF(storage), HASH_OF(intern->array), (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + storage = intern->array; + zval_add_ref(&storage); + + if (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) { + zclass.s = "ArrayIterator"; + class_len = sizeof("ArrayIterator") - 1; + } else { + zclass.s = "ArrayObject"; + class_len = sizeof("ArrayObject") - 1; + } + zprop.s = "storage"; + prop_len = sizeof("storage") - 1; + if (UG(unicode)) { + zclass.u = zend_ascii_to_unicode(zclass.s, class_len + 1 ZEND_FILE_LINE_CC); + zprop.u = zend_ascii_to_unicode(zprop.s, prop_len + 1 ZEND_FILE_LINE_CC); + zend_u_mangle_property_name(&zname, &name_len, IS_UNICODE, zclass, class_len, zprop, prop_len, 0); + zend_u_symtable_update(rv, IS_UNICODE, zname, name_len+1, &storage, sizeof(zval *), NULL); + efree(zname.v); + efree(zclass.v); + efree(zprop.v); + } else { + zend_mangle_property_name(&zname.s, &name_len, zclass.s, class_len, zprop.s, prop_len, 0); + zend_symtable_update(rv, zname.s, name_len+1, &storage, sizeof(zval *), NULL); + efree(zname.v); + } + + return rv; + } +} +/* }}} */ + static zval *spl_array_read_property(zval *object, zval *member, int type TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); @@ -1512,6 +1566,7 @@ PHP_MINIT_FUNCTION(spl_array) spl_handler_ArrayObject.count_elements = spl_array_object_count_elements; spl_handler_ArrayObject.get_properties = spl_array_get_properties; + spl_handler_ArrayObject.get_debug_info = spl_array_get_debug_info; spl_handler_ArrayObject.read_property = spl_array_read_property; spl_handler_ArrayObject.write_property = spl_array_write_property; spl_handler_ArrayObject.get_property_ptr_ptr = spl_array_get_property_ptr_ptr; diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/array_001.phpt index 8ddfdc67c6..3945b89b9c 100755 --- a/ext/spl/tests/array_001.phpt +++ b/ext/spl/tests/array_001.phpt @@ -38,11 +38,14 @@ var_dump($ar); ===DONE=== --EXPECTF-- -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [1]=> - int(1) +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + int(0) + [1]=> + int(1) + } } int(2) int(3) @@ -61,17 +64,20 @@ array(6) { int(5) } string(1) "a" -object(ArrayObject)#1 (5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - ["a"]=> - string(1) "a" +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + ["a"]=> + string(1) "a" + } } int(0) @@ -84,29 +90,38 @@ NULL Notice: Undefined offset: 7 in %sarray_001.php on line %d Notice: Undefined index: c in %sarray_001.php on line %d -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [2]=> - int(2) +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + int(0) + [2]=> + int(2) + } } -object(ArrayObject)#1 (4) { - [0]=> - int(0) - [2]=> - int(2) - [4]=> - string(1) "3" - [5]=> - int(4) +object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(4) { + [0]=> + int(0) + [2]=> + int(2) + [4]=> + string(1) "3" + [5]=> + int(4) + } } ===DONE=== --UEXPECTF-- -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [1]=> - int(1) +object(ArrayObject)#1 (1) { + [u"storage":u"ArrayObject":private]=> + array(2) { + [0]=> + int(0) + [1]=> + int(1) + } } int(2) int(3) @@ -125,17 +140,20 @@ array(6) { int(5) } unicode(1) "a" -object(ArrayObject)#1 (5) { - [0]=> - int(0) - [1]=> - int(1) - [2]=> - int(2) - [3]=> - int(3) - [u"a"]=> - unicode(1) "a" +object(ArrayObject)#1 (1) { + [u"storage":u"ArrayObject":private]=> + array(5) { + [0]=> + int(0) + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) + [u"a"]=> + unicode(1) "a" + } } int(0) @@ -148,20 +166,26 @@ NULL Notice: Undefined offset: 7 in %sarray_001.php on line %d Notice: Undefined index: c in %sarray_001.php on line %d -object(ArrayObject)#1 (2) { - [0]=> - int(0) - [2]=> - int(2) +object(ArrayObject)#1 (1) { + [u"storage":u"ArrayObject":private]=> + array(2) { + [0]=> + int(0) + [2]=> + int(2) + } } -object(ArrayObject)#1 (4) { - [0]=> - int(0) - [2]=> - int(2) - [4]=> - unicode(1) "3" - [5]=> - int(4) +object(ArrayObject)#1 (1) { + [u"storage":u"ArrayObject":private]=> + array(4) { + [0]=> + int(0) + [2]=> + int(2) + [4]=> + unicode(1) "3" + [5]=> + int(4) + } } ===DONE=== diff --git a/ext/spl/tests/array_002.phpt b/ext/spl/tests/array_002.phpt index 122953c975..d581cb9f0b 100755 --- a/ext/spl/tests/array_002.phpt +++ b/ext/spl/tests/array_002.phpt @@ -22,30 +22,42 @@ var_dump($arrayObject); ===DONE=== --EXPECTF-- -object(ArrayObject)#%d (5) { - [1]=> - string(3) "one" - [2]=> - string(3) "two" - [3]=> - string(5) "three" - [4]=> - string(4) "four" - [5]=> - string(4) "five" +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + object(ArrayObject)#1 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + [1]=> + string(3) "one" + [2]=> + string(3) "two" + [3]=> + string(5) "three" + [4]=> + string(4) "four" + [5]=> + string(4) "five" + } + } } ===DONE=== --UEXPECTF-- -object(ArrayObject)#%d (5) { - [1]=> - unicode(3) "one" - [2]=> - unicode(3) "two" - [3]=> - unicode(5) "three" - [4]=> - unicode(4) "four" - [5]=> - unicode(4) "five" +object(ArrayObject)#%d (1) { + [u"storage":u"ArrayObject":private]=> + object(ArrayObject)#1 (1) { + [u"storage":u"ArrayObject":private]=> + array(5) { + [1]=> + unicode(3) "one" + [2]=> + unicode(3) "two" + [3]=> + unicode(5) "three" + [4]=> + unicode(4) "four" + [5]=> + unicode(4) "five" + } + } } ===DONE=== diff --git a/ext/spl/tests/array_003.phpt b/ext/spl/tests/array_003.phpt index f0ddb791c6..a7f44e1ca3 100755 --- a/ext/spl/tests/array_003.phpt +++ b/ext/spl/tests/array_003.phpt @@ -49,11 +49,15 @@ test Object ) ArrayObject Object ( - [pub] => public - [pro:protected] => protected - [pri:test:private] => private - [imp] => implicit - [dyn] => dynamic + [storage:ArrayObject:private] => test Object + ( + [pub] => public + [pro:protected] => protected + [pri:test:private] => private + [imp] => implicit + [dyn] => dynamic + ) + ) pub => public imp => implicit diff --git a/ext/spl/tests/array_007.phpt b/ext/spl/tests/array_007.phpt index 645794e24e..269d71cb6e 100755 --- a/ext/spl/tests/array_007.phpt +++ b/ext/spl/tests/array_007.phpt @@ -53,11 +53,19 @@ test Object ) ArrayIterator Object ( - [pub] => public - [pro:protected] => protected - [pri:test:private] => private - [imp] => implicit - [dyn] => dynamic + [storage:ArrayIterator:private] => ArrayObject Object + ( + [storage:ArrayObject:private] => test Object + ( + [pub] => public + [pro:protected] => protected + [pri:test:private] => private + [imp] => implicit + [dyn] => dynamic + ) + + ) + ) pub => public imp => implicit diff --git a/ext/spl/tests/array_015.phpt b/ext/spl/tests/array_015.phpt index 79d6a867f0..a21bab5344 100755 --- a/ext/spl/tests/array_015.phpt +++ b/ext/spl/tests/array_015.phpt @@ -43,38 +43,47 @@ var_dump($ar); ===DONE=== --EXPECTF-- -object(ArrayObject)#%d (5) { - [0]=> - int(1) - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(5) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + } } Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d int(2) -object(ArrayObject)#%d (4) { - [1]=> - int(2) - [2]=> - int(3) - [3]=> - int(4) - [4]=> - int(5) +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(4) { + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + } } 1=>2 3=>4 -object(ArrayObject)#%d (2) { - [1]=> - int(2) - [3]=> - int(4) +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(2) { + [1]=> + int(2) + [3]=> + int(4) + } } 1=>2 @@ -82,6 +91,9 @@ Notice: main(): ArrayIterator::next(): Array was modified outside object and int 3=>4 Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d -object(ArrayObject)#%d (0) { +object(ArrayObject)#%d (1) { + %s"storage"%s"ArrayObject":private]=> + array(0) { + } } ===DONE=== diff --git a/ext/spl/tests/array_017.phpt b/ext/spl/tests/array_017.phpt index d145433834..4ffe283d09 100755 --- a/ext/spl/tests/array_017.phpt +++ b/ext/spl/tests/array_017.phpt @@ -148,13 +148,26 @@ array(3) { int(42) } ["$this"]=> - object(ArrayObjectEx)#1 (3) { - [0]=> - int(1) - ["a"]=> - int(25) + object(ArrayObjectEx)#%d (6) { ["pub1"]=> - int(42) + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } } } ArrayObjectEx::show() @@ -172,13 +185,39 @@ array(3) { int(42) } ["$this"]=> - object(ArrayIteratorEx)#2 (3) { - [0]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } } } array(1) { @@ -208,13 +247,39 @@ array(3) { int(42) } ["$this"]=> - object(ArrayIteratorEx)#3 (3) { - [0]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> int(1) - ["a"]=> - int(25) - ["pub1"]=> - int(42) + ["pro2":protected]=> + int(2) + ["pri2":"ArrayIteratorEx":private]=> + int(3) + ["imp2"]=> + int(4) + ["dyn2"]=> + int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } } } array(1) { @@ -260,7 +325,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayObjectEx)#1 (5) { + object(ArrayObjectEx)#%d (6) { ["pub1"]=> int(1) ["pro1":protected]=> @@ -271,6 +336,15 @@ array(3) { int(4) ["dyn1"]=> int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } } } ArrayObjectEx::show() @@ -294,7 +368,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayIteratorEx)#3 (5) { + object(ArrayIteratorEx)#%d (6) { ["pub2"]=> int(1) ["pro2":protected]=> @@ -305,6 +379,28 @@ array(3) { int(4) ["dyn2"]=> int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } } } array(1) { @@ -340,7 +436,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayIteratorEx)#2 (5) { + object(ArrayIteratorEx)#%d (6) { ["pub2"]=> int(1) ["pro2":protected]=> @@ -351,6 +447,28 @@ array(3) { int(4) ["dyn2"]=> int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + ["storage":"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + ["a"]=> + int(25) + ["pub1"]=> + int(42) + } + } } } array(1) { @@ -398,7 +516,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayObjectEx)#1 (5) { + object(ArrayObjectEx)#%d (5) { ["pub1"]=> int(1) ["pro1":protected]=> @@ -430,17 +548,30 @@ array(3) { int(5) } ["$this"]=> - object(ArrayIteratorEx)#2 (5) { - ["pub1"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> int(1) - ["pro1":protected]=> + ["pro2":protected]=> int(2) - ["pri1":"ArrayObjectEx":private]=> + ["pri2":"ArrayIteratorEx":private]=> int(3) - ["imp1"]=> + ["imp2"]=> int(4) - ["dyn1"]=> + ["dyn2"]=> int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } } } array(1) { @@ -474,17 +605,30 @@ array(3) { int(5) } ["$this"]=> - object(ArrayIteratorEx)#3 (5) { - ["pub1"]=> + object(ArrayIteratorEx)#%d (6) { + ["pub2"]=> int(1) - ["pro1":protected]=> + ["pro2":protected]=> int(2) - ["pri1":"ArrayObjectEx":private]=> + ["pri2":"ArrayIteratorEx":private]=> int(3) - ["imp1"]=> + ["imp2"]=> int(4) - ["dyn1"]=> + ["dyn2"]=> int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } } } array(1) { @@ -530,7 +674,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayObjectEx)#1 (5) { + object(ArrayObjectEx)#%d (5) { ["pub1"]=> int(1) ["pro1":protected]=> @@ -564,7 +708,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayIteratorEx)#3 (5) { + object(ArrayIteratorEx)#%d (6) { ["pub2"]=> int(1) ["pro2":protected]=> @@ -575,6 +719,19 @@ array(3) { int(4) ["dyn2"]=> int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } } } array(1) { @@ -610,7 +767,7 @@ array(3) { int(5) } ["$this"]=> - object(ArrayIteratorEx)#2 (5) { + object(ArrayIteratorEx)#%d (6) { ["pub2"]=> int(1) ["pro2":protected]=> @@ -621,6 +778,19 @@ array(3) { int(4) ["dyn2"]=> int(5) + ["storage":"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + ["pub1"]=> + int(1) + ["pro1":protected]=> + int(2) + ["pri1":"ArrayObjectEx":private]=> + int(3) + ["imp1"]=> + int(4) + ["dyn1"]=> + int(5) + } } } array(1) { @@ -663,13 +833,26 @@ array(3) { int(42) } [u"$this"]=> - object(ArrayObjectEx)#1 (3) { - [0]=> - int(1) - [u"a"]=> - int(25) + object(ArrayObjectEx)#%d (6) { [u"pub1"]=> - int(42) + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + [u"storage":u"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [u"a"]=> + int(25) + [u"pub1"]=> + int(42) + } } } ArrayObjectEx::show() @@ -687,13 +870,39 @@ array(3) { int(42) } [u"$this"]=> - object(ArrayIteratorEx)#2 (3) { - [0]=> + object(ArrayIteratorEx)#%d (6) { + [u"pub2"]=> int(1) - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) + [u"pro2":protected]=> + int(2) + [u"pri2":u"ArrayIteratorEx":private]=> + int(3) + [u"imp2"]=> + int(4) + [u"dyn2"]=> + int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + [u"storage":u"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [u"a"]=> + int(25) + [u"pub1"]=> + int(42) + } + } } } array(1) { @@ -723,13 +932,39 @@ array(3) { int(42) } [u"$this"]=> - object(ArrayIteratorEx)#3 (3) { - [0]=> + object(ArrayIteratorEx)#%d (6) { + [u"pub2"]=> int(1) - [u"a"]=> - int(25) - [u"pub1"]=> - int(42) + [u"pro2":protected]=> + int(2) + [u"pri2":u"ArrayIteratorEx":private]=> + int(3) + [u"imp2"]=> + int(4) + [u"dyn2"]=> + int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + [u"storage":u"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [u"a"]=> + int(25) + [u"pub1"]=> + int(42) + } + } } } array(1) { @@ -775,7 +1010,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayObjectEx)#1 (5) { + object(ArrayObjectEx)#%d (6) { [u"pub1"]=> int(1) [u"pro1":protected]=> @@ -786,6 +1021,15 @@ array(3) { int(4) [u"dyn1"]=> int(5) + [u"storage":u"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [u"a"]=> + int(25) + [u"pub1"]=> + int(42) + } } } ArrayObjectEx::show() @@ -809,7 +1053,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayIteratorEx)#3 (5) { + object(ArrayIteratorEx)#%d (6) { [u"pub2"]=> int(1) [u"pro2":protected]=> @@ -820,6 +1064,28 @@ array(3) { int(4) [u"dyn2"]=> int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + [u"storage":u"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [u"a"]=> + int(25) + [u"pub1"]=> + int(42) + } + } } } array(1) { @@ -855,7 +1121,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayIteratorEx)#2 (5) { + object(ArrayIteratorEx)#%d (6) { [u"pub2"]=> int(1) [u"pro2":protected]=> @@ -866,6 +1132,28 @@ array(3) { int(4) [u"dyn2"]=> int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (6) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + [u"storage":u"ArrayObject":private]=> + array(3) { + [0]=> + int(1) + [u"a"]=> + int(25) + [u"pub1"]=> + int(42) + } + } } } array(1) { @@ -913,7 +1201,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayObjectEx)#1 (5) { + object(ArrayObjectEx)#%d (5) { [u"pub1"]=> int(1) [u"pro1":protected]=> @@ -945,17 +1233,30 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayIteratorEx)#2 (5) { - [u"pub1"]=> + object(ArrayIteratorEx)#%d (6) { + [u"pub2"]=> int(1) - [u"pro1":protected]=> + [u"pro2":protected]=> int(2) - [u"pri1":u"ArrayObjectEx":private]=> + [u"pri2":u"ArrayIteratorEx":private]=> int(3) - [u"imp1"]=> + [u"imp2"]=> int(4) - [u"dyn1"]=> + [u"dyn2"]=> int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + } } } array(1) { @@ -989,17 +1290,30 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayIteratorEx)#3 (5) { - [u"pub1"]=> + object(ArrayIteratorEx)#%d (6) { + [u"pub2"]=> int(1) - [u"pro1":protected]=> + [u"pro2":protected]=> int(2) - [u"pri1":u"ArrayObjectEx":private]=> + [u"pri2":u"ArrayIteratorEx":private]=> int(3) - [u"imp1"]=> + [u"imp2"]=> int(4) - [u"dyn1"]=> + [u"dyn2"]=> int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + } } } array(1) { @@ -1045,7 +1359,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayObjectEx)#1 (5) { + object(ArrayObjectEx)#%d (5) { [u"pub1"]=> int(1) [u"pro1":protected]=> @@ -1079,7 +1393,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayIteratorEx)#3 (5) { + object(ArrayIteratorEx)#%d (6) { [u"pub2"]=> int(1) [u"pro2":protected]=> @@ -1090,6 +1404,19 @@ array(3) { int(4) [u"dyn2"]=> int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + } } } array(1) { @@ -1125,7 +1452,7 @@ array(3) { int(5) } [u"$this"]=> - object(ArrayIteratorEx)#2 (5) { + object(ArrayIteratorEx)#%d (6) { [u"pub2"]=> int(1) [u"pro2":protected]=> @@ -1136,6 +1463,19 @@ array(3) { int(4) [u"dyn2"]=> int(5) + [u"storage":u"ArrayIterator":private]=> + object(ArrayObjectEx)#%d (5) { + [u"pub1"]=> + int(1) + [u"pro1":protected]=> + int(2) + [u"pri1":u"ArrayObjectEx":private]=> + int(3) + [u"imp1"]=> + int(4) + [u"dyn1"]=> + int(5) + } } } array(1) { diff --git a/ext/spl/tests/array_018.phpt b/ext/spl/tests/array_018.phpt index 0cb8827995..501e740270 100755 --- a/ext/spl/tests/array_018.phpt +++ b/ext/spl/tests/array_018.phpt @@ -34,17 +34,29 @@ var_dump($foo); ===DONE=== --EXPECTF-- string(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(0) { + } } string(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { +object(ArrayObject)#%d (1) { + ["storage":"ArrayObject":private]=> + array(0) { + } } ===DONE=== --UEXPECTF-- unicode(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { +object(ArrayObject)#%d (1) { + [u"storage":u"ArrayObject":private]=> + array(0) { + } } unicode(44) "An offset must not begin with \0 or be empty" -object(ArrayObject)#%d (0) { +object(ArrayObject)#%d (1) { + [u"storage":u"ArrayObject":private]=> + array(0) { + } } ===DONE=== diff --git a/ext/spl/tests/array_022.phpt b/ext/spl/tests/array_022.phpt index 1067b03bf8..f210c090d1 100755 --- a/ext/spl/tests/array_022.phpt +++ b/ext/spl/tests/array_022.phpt @@ -52,22 +52,32 @@ object(MyArrayObject)#%d (1) { ["bar"]=> string(3) "baz" } -object(MyArrayObject)#%d (2) { +object(MyArrayObject)#%d (3) { ["bar"]=> string(3) "baz" ["baz"]=> string(3) "Foo" + ["storage":"ArrayObject":private]=> + array(1) { + ["bar"]=> + string(3) "baz" + } } ==ArrayIterator=== object(MyArrayIterator)#%d (1) { ["bar"]=> string(3) "baz" } -object(MyArrayIterator)#%d (2) { +object(MyArrayIterator)#%d (3) { ["bar"]=> string(3) "baz" ["baz"]=> string(3) "Foo" + ["storage":"ArrayIterator":private]=> + object(MyArrayIterator)#%d (1) { + ["bar"]=> + string(3) "baz" + } } ===DONE=== --UEXPECTF-- @@ -76,21 +86,31 @@ object(MyArrayObject)#%d (1) { [u"bar"]=> unicode(3) "baz" } -object(MyArrayObject)#%d (2) { +object(MyArrayObject)#%d (3) { [u"bar"]=> unicode(3) "baz" [u"baz"]=> unicode(3) "Foo" + [u"storage":u"ArrayObject":private]=> + array(1) { + [u"bar"]=> + unicode(3) "baz" + } } ==ArrayIterator=== object(MyArrayIterator)#%d (1) { [u"bar"]=> unicode(3) "baz" } -object(MyArrayIterator)#%d (2) { +object(MyArrayIterator)#%d (3) { [u"bar"]=> unicode(3) "baz" [u"baz"]=> unicode(3) "Foo" + [u"storage":u"ArrayIterator":private]=> + object(MyArrayIterator)#%d (1) { + [u"bar"]=> + unicode(3) "baz" + } } ===DONE=== diff --git a/ext/spl/tests/bug33136.phpt b/ext/spl/tests/bug33136.phpt index f0fe8d41a0..fbb766bae5 100755 --- a/ext/spl/tests/bug33136.phpt +++ b/ext/spl/tests/bug33136.phpt @@ -66,9 +66,20 @@ Collection::offsetGet(foo) string(3) "baz" Collection Object ( - [0] => foo - [1] => bar - [foo] => baz + [data:Collection:private] => Array + ( + [0] => foo + [1] => bar + [foo] => baz + ) + + [storage:ArrayObject:private] => Array + ( + [0] => foo + [1] => bar + [foo] => baz + ) + ) int(3) ===DONE=== @@ -88,9 +99,20 @@ Collection::offsetGet(foo) unicode(3) "baz" Collection Object ( - [0] => foo - [1] => bar - [foo] => baz + [data:Collection:private] => Array + ( + [0] => foo + [1] => bar + [foo] => baz + ) + + [storage:ArrayObject:private] => Array + ( + [0] => foo + [1] => bar + [foo] => baz + ) + ) int(3) ===DONE=== diff --git a/ext/spl/tests/iterator_042.phpt b/ext/spl/tests/iterator_042.phpt index 8615450654..4f470849af 100755 --- a/ext/spl/tests/iterator_042.phpt +++ b/ext/spl/tests/iterator_042.phpt @@ -40,41 +40,62 @@ foreach($it as $k => $v) --EXPECTF-- Error Argument 1 passed to AppendIterator::append() must implement interface Iterator, array given in %siterator_042.php on line %d -object(ArrayIterator)#%d (2) { - [0]=> - object(ArrayIterator)#%d (1) { +object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(2) { [0]=> - int(1) - } - [1]=> - object(ArrayIterator)#%d (2) { - [0]=> - int(21) + object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(1) { + [0]=> + int(1) + } + } [1]=> - int(22) + object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(2) { + [0]=> + int(21) + [1]=> + int(22) + } + } } } -object(ArrayIterator)#%d (3) { - [0]=> - object(ArrayIterator)#%d (1) { - [0]=> - int(1) - } - [1]=> - object(ArrayIterator)#%d (2) { - [0]=> - int(21) - [1]=> - int(22) - } - [2]=> - object(ArrayIterator)#5 (3) { +object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(3) { [0]=> - int(31) + object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(1) { + [0]=> + int(1) + } + } [1]=> - int(32) + object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(2) { + [0]=> + int(21) + [1]=> + int(22) + } + } [2]=> - int(33) + object(ArrayIterator)#5 (1) { + %s"storage"%s"ArrayIterator":private]=> + array(3) { + [0]=> + int(31) + [1]=> + int(32) + [2]=> + int(33) + } + } } } ===0=== diff --git a/ext/spl/tests/iterator_049.phpt b/ext/spl/tests/iterator_049.phpt index d9950f12b9..756cdbcec6 100755 --- a/ext/spl/tests/iterator_049.phpt +++ b/ext/spl/tests/iterator_049.phpt @@ -14,8 +14,11 @@ var_dump($ar->getArrayCopy()); --EXPECTF-- object(ArrayIterator)#%d (1) { - [""]=> - NULL + ["storage":"ArrayIterator":private]=> + array(1) { + [""]=> + NULL + } } array(1) { [""]=> @@ -24,8 +27,11 @@ array(1) { ===DONE=== --UEXPECTF-- object(ArrayIterator)#%d (1) { - [u""]=> - NULL + [u"storage":u"ArrayIterator":private]=> + array(1) { + [u""]=> + NULL + } } array(1) { [u""]=> diff --git a/ext/spl/tests/iterator_049b.phpt b/ext/spl/tests/iterator_049b.phpt index 9e5396db22..4395d95572 100755 Binary files a/ext/spl/tests/iterator_049b.phpt and b/ext/spl/tests/iterator_049b.phpt differ diff --git a/ext/spl/tests/iterator_050.phpt b/ext/spl/tests/iterator_050.phpt index 7ecc534b4d..5d9d381618 100755 --- a/ext/spl/tests/iterator_050.phpt +++ b/ext/spl/tests/iterator_050.phpt @@ -69,25 +69,28 @@ array(2) { [1]=> %s(1) "1" } -object(ArrayIterator)#%d (9) { - [0]=> - %s(1) "1" - [1]=> - %s(3) "1,2" - [2]=> - %s(5) "1,2,3" - [3]=> - %s(0) "" - [4]=> - NULL - [5]=> - array(0) { +object(ArrayIterator)#%d (1) { + %s"storage"%s"ArrayIterator":private]=> + array(9) { + [0]=> + %s(1) "1" + [1]=> + %s(3) "1,2" + [2]=> + %s(5) "1,2,3" + [3]=> + %s(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + %s(6) "FooBar" + [7]=> + %s(1) "," + [8]=> + %s(2) ",," } - [6]=> - %s(6) "FooBar" - [7]=> - %s(1) "," - [8]=> - %s(2) ",," } ===DONE=== diff --git a/ext/spl/tests/iterator_051.phpt b/ext/spl/tests/iterator_051.phpt index 67b566c4ff..db5438d043 100755 --- a/ext/spl/tests/iterator_051.phpt +++ b/ext/spl/tests/iterator_051.phpt @@ -76,21 +76,24 @@ array(2) { [1]=> string(1) "0" } -object(ArrayIterator)#%d (7) { - [1]=> - int(0) - ["1,2"]=> - int(1) - ["1,2,3"]=> - int(2) - [0]=> - int(3) - ["FooBar"]=> - int(4) - [","]=> - int(5) - [",,"]=> - int(6) +object(ArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(7) { + [1]=> + int(0) + ["1,2"]=> + int(1) + ["1,2,3"]=> + int(2) + [0]=> + int(3) + ["FooBar"]=> + int(4) + [","]=> + int(5) + [",,"]=> + int(6) + } } ===DONE=== --UEXPECTF-- @@ -140,20 +143,23 @@ array(2) { [1]=> unicode(1) "0" } -object(ArrayIterator)#1 (7) { - [1]=> - int(0) - [u"1,2"]=> - int(1) - [u"1,2,3"]=> - int(2) - [0]=> - int(3) - [u"FooBar"]=> - int(4) - [u","]=> - int(5) - [u",,"]=> - int(6) +object(ArrayIterator)#1 (1) { + [u"storage":u"ArrayIterator":private]=> + array(7) { + [1]=> + int(0) + [u"1,2"]=> + int(1) + [u"1,2,3"]=> + int(2) + [0]=> + int(3) + [u"FooBar"]=> + int(4) + [u","]=> + int(5) + [u",,"]=> + int(6) + } } ===DONE=== diff --git a/ext/spl/tests/iterator_052.phpt b/ext/spl/tests/iterator_052.phpt index 1e1ef201aa..28a55548ca 100755 --- a/ext/spl/tests/iterator_052.phpt +++ b/ext/spl/tests/iterator_052.phpt @@ -290,26 +290,29 @@ array(2) { array(0) { } } -object(ArrayIterator)#%d (9) { - [0]=> - %s(1) "1" - [1]=> - %s(3) "1,2" - [2]=> - %s(5) "1,2,3" - [3]=> - %s(0) "" - [4]=> - NULL - [5]=> - array(0) { +object(ArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(9) { + [0]=> + %s(1) "1" + [1]=> + %s(3) "1,2" + [2]=> + %s(5) "1,2,3" + [3]=> + %s(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + %s(6) "FooBar" + [7]=> + %s(1) "," + [8]=> + %s(2) ",," } - [6]=> - %s(6) "FooBar" - [7]=> - %s(1) "," - [8]=> - %s(2) ",," } ===DONE=== --UEXPECTF-- @@ -556,25 +559,28 @@ array(2) { array(0) { } } -object(ArrayIterator)#%d (9) { - [0]=> - unicode(1) "1" - [1]=> - unicode(3) "1,2" - [2]=> - unicode(5) "1,2,3" - [3]=> - unicode(0) "" - [4]=> - NULL - [5]=> - array(0) { - } - [6]=> - unicode(6) "FooBar" - [7]=> - unicode(1) "," - [8]=> - unicode(2) ",," +object(ArrayIterator)#%d (1) { + [u"storage":u"ArrayIterator":private]=> + array(9) { + [0]=> + unicode(1) "1" + [1]=> + unicode(3) "1,2" + [2]=> + unicode(5) "1,2,3" + [3]=> + unicode(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + unicode(6) "FooBar" + [7]=> + unicode(1) "," + [8]=> + unicode(2) ",," + } } ===DONE=== diff --git a/ext/spl/tests/iterator_053.phpt b/ext/spl/tests/iterator_053.phpt index c64c2aada6..eda6686734 100755 --- a/ext/spl/tests/iterator_053.phpt +++ b/ext/spl/tests/iterator_053.phpt @@ -290,26 +290,29 @@ array(2) { string(1) "8" } } -object(ArrayIterator)#%d (9) { - [0]=> - %s(1) "1" - [1]=> - %s(3) "1,2" - [2]=> - %s(5) "1,2,3" - [3]=> - %s(0) "" - [4]=> - NULL - [5]=> - array(0) { +object(ArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(9) { + [0]=> + %s(1) "1" + [1]=> + %s(3) "1,2" + [2]=> + %s(5) "1,2,3" + [3]=> + %s(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + %s(6) "FooBar" + [7]=> + %s(1) "," + [8]=> + %s(2) ",," } - [6]=> - %s(6) "FooBar" - [7]=> - %s(1) "," - [8]=> - %s(2) ",," } ===DONE=== --UEXPECTF-- @@ -556,25 +559,28 @@ array(2) { unicode(1) "8" } } -object(ArrayIterator)#%d (9) { - [0]=> - unicode(1) "1" - [1]=> - unicode(3) "1,2" - [2]=> - unicode(5) "1,2,3" - [3]=> - unicode(0) "" - [4]=> - NULL - [5]=> - array(0) { - } - [6]=> - unicode(6) "FooBar" - [7]=> - unicode(1) "," - [8]=> - unicode(2) ",," +object(ArrayIterator)#%d (1) { + [u"storage":u"ArrayIterator":private]=> + array(9) { + [0]=> + unicode(1) "1" + [1]=> + unicode(3) "1,2" + [2]=> + unicode(5) "1,2,3" + [3]=> + unicode(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + unicode(6) "FooBar" + [7]=> + unicode(1) "," + [8]=> + unicode(2) ",," + } } ===DONE=== diff --git a/ext/spl/tests/iterator_054.phpt b/ext/spl/tests/iterator_054.phpt index 759c61bc8c..f7039f9b2b 100755 --- a/ext/spl/tests/iterator_054.phpt +++ b/ext/spl/tests/iterator_054.phpt @@ -60,26 +60,29 @@ array(3) { [2]=> string(0) "" } -object(ArrayIterator)#%d (9) { - [0]=> - %s(1) "1" - [1]=> - %s(3) "1,2" - [2]=> - %s(5) "1,2,3" - [3]=> - %s(0) "" - [4]=> - NULL - [5]=> - array(0) { +object(ArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(9) { + [0]=> + %s(1) "1" + [1]=> + %s(3) "1,2" + [2]=> + %s(5) "1,2,3" + [3]=> + %s(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + %s(6) "FooBar" + [7]=> + %s(1) "," + [8]=> + %s(2) ",," } - [6]=> - %s(6) "FooBar" - [7]=> - %s(1) "," - [8]=> - %s(2) ",," } ===DONE=== --UEXPECTF-- @@ -115,25 +118,28 @@ array(3) { [2]=> unicode(0) "" } -object(ArrayIterator)#%d (9) { - [0]=> - unicode(1) "1" - [1]=> - unicode(3) "1,2" - [2]=> - unicode(5) "1,2,3" - [3]=> - unicode(0) "" - [4]=> - NULL - [5]=> - array(0) { +object(ArrayIterator)#%d (1) { + [u"storage":u"ArrayIterator":private]=> + array(9) { + [0]=> + unicode(1) "1" + [1]=> + unicode(3) "1,2" + [2]=> + unicode(5) "1,2,3" + [3]=> + unicode(0) "" + [4]=> + NULL + [5]=> + array(0) { + } + [6]=> + unicode(6) "FooBar" + [7]=> + unicode(1) "," + [8]=> + unicode(2) ",," } - [6]=> - unicode(6) "FooBar" - [7]=> - unicode(1) "," - [8]=> - unicode(2) ",," } ===DONE=== diff --git a/ext/spl/tests/iterator_055.phpt b/ext/spl/tests/iterator_055.phpt index e7854755cc..32ebc8445d 100755 --- a/ext/spl/tests/iterator_055.phpt +++ b/ext/spl/tests/iterator_055.phpt @@ -42,21 +42,24 @@ array(2) { [1]=> string(2) ",3" } -object(ArrayIterator)#%d (7) { - [1]=> - int(0) - ["1,2"]=> - int(1) - ["1,2,3"]=> - int(2) - [0]=> - int(3) - ["FooBar"]=> - int(4) - [","]=> - int(5) - [",,"]=> - int(6) +object(ArrayIterator)#%d (1) { + ["storage":"ArrayIterator":private]=> + array(7) { + [1]=> + int(0) + ["1,2"]=> + int(1) + ["1,2,3"]=> + int(2) + [0]=> + int(3) + ["FooBar"]=> + int(4) + [","]=> + int(5) + [",,"]=> + int(6) + } } ===DONE=== --UEXPECTF-- @@ -74,20 +77,23 @@ array(2) { [1]=> unicode(2) ",3" } -object(ArrayIterator)#%d (7) { - [1]=> - int(0) - [u"1,2"]=> - int(1) - [u"1,2,3"]=> - int(2) - [0]=> - int(3) - [u"FooBar"]=> - int(4) - [u","]=> - int(5) - [u",,"]=> - int(6) +object(ArrayIterator)#%d (1) { + [u"storage":u"ArrayIterator":private]=> + array(7) { + [1]=> + int(0) + [u"1,2"]=> + int(1) + [u"1,2,3"]=> + int(2) + [0]=> + int(3) + [u"FooBar"]=> + int(4) + [u","]=> + int(5) + [u",,"]=> + int(6) + } } ===DONE===