]> granicus.if.org Git - php/commitdiff
Add consistency with the flag
authorEtienne Kneuss <colder@php.net>
Tue, 6 May 2008 23:08:06 +0000 (23:08 +0000)
committerEtienne Kneuss <colder@php.net>
Tue, 6 May 2008 23:08:06 +0000 (23:08 +0000)
ext/spl/spl_array.c
ext/spl/tests/bug38618.phpt

index 4bde150dff9f9a65e2d35a49c93ea7954dbdd0dc..523729e70cf3dc85ee66e49bff92aec96441e53d 100755 (executable)
@@ -947,9 +947,6 @@ SPL_METHOD(Array, __construct)
 
        if (Z_TYPE_PP(array) == IS_ARRAY) {
                SEPARATE_ZVAL_IF_NOT_REF(array);
-               if (ZEND_NUM_ARGS() < 2) {
-                       ar_flags |= SPL_ARRAY_CHILD_ARRAYS_ONLY;
-               }
        }
 
        if (ZEND_NUM_ARGS() > 2) {
@@ -1737,11 +1734,12 @@ PHP_MINIT_FUNCTION(spl_array)
 
        REGISTER_SPL_CLASS_CONST_LONG(ArrayObject,   "STD_PROP_LIST",    SPL_ARRAY_STD_PROP_LIST);
        REGISTER_SPL_CLASS_CONST_LONG(ArrayObject,   "ARRAY_AS_PROPS",   SPL_ARRAY_ARRAY_AS_PROPS);
-       REGISTER_SPL_CLASS_CONST_LONG(ArrayObject,   "CHILD_ARRAYS_ONLY",SPL_ARRAY_CHILD_ARRAYS_ONLY);
 
        REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "STD_PROP_LIST",    SPL_ARRAY_STD_PROP_LIST);
        REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "ARRAY_AS_PROPS",   SPL_ARRAY_ARRAY_AS_PROPS);
-       REGISTER_SPL_CLASS_CONST_LONG(ArrayIterator, "CHILD_ARRAYS_ONLY",SPL_ARRAY_CHILD_ARRAYS_ONLY);
+
+       REGISTER_SPL_CLASS_CONST_LONG(RecursiveArrayIterator, "CHILD_ARRAYS_ONLY", SPL_ARRAY_CHILD_ARRAYS_ONLY);
+
        return SUCCESS;
 }
 /* }}} */
index 4fcfff9786a2dcd20d86d634031a030bb015ab44..17439b49732ce81ccfa45e08ddc3c43f03778bed 100644 (file)
@@ -81,8 +81,8 @@ $array = array(
 
 test_array($array, 'Protected Property');
 
-test_array($array, 'Public Property New', ArrayIterator::CHILD_ARRAYS_ONLY);
-test_array($array, 'Protected Property New', ArrayIterator::CHILD_ARRAYS_ONLY);
+test_array($array, 'Public Property New', RecursiveArrayIterator::CHILD_ARRAYS_ONLY);
+test_array($array, 'Protected Property New', RecursiveArrayIterator::CHILD_ARRAYS_ONLY);
 ?>
 ===DONE===
 <?php exit(0); ?>