From: Etienne Kneuss Date: Tue, 6 May 2008 23:08:06 +0000 (+0000) Subject: Add consistency with the flag X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~271 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06cef68307f3f02d1bc1d961d5985b85fca379f6;p=php Add consistency with the flag --- diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 4bde150dff..523729e70c 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -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; } /* }}} */ diff --git a/ext/spl/tests/bug38618.phpt b/ext/spl/tests/bug38618.phpt index 4fcfff9786..17439b4973 100644 --- a/ext/spl/tests/bug38618.phpt +++ b/ext/spl/tests/bug38618.phpt @@ -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===