From: Marcus Boerger Date: Sat, 1 Apr 2006 22:39:42 +0000 (+0000) Subject: - Bugfix #36941 (ArrayIterator does not clone itself) X-Git-Tag: RELEASE_1_3~174 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac099ca676fb97df2ead41be379f360aca31a86c;p=php - Bugfix #36941 (ArrayIterator does not clone itself) --- diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 80b70dedbf..b8d2217cf0 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -228,6 +228,7 @@ static zend_object_value spl_array_object_clone(zval *zobject TSRMLS_DC) spl_array_object *intern; old_object = zend_objects_get_address(zobject TSRMLS_CC); + SEPARATE_ZVAL(&zobject); new_obj_val = spl_array_object_new_ex(old_object->ce, &intern, zobject TSRMLS_CC); new_object = &intern->std; diff --git a/ext/spl/tests/bug36941.phpt b/ext/spl/tests/bug36941.phpt new file mode 100755 index 0000000000..737ff828b2 --- /dev/null +++ b/ext/spl/tests/bug36941.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #36941 (ArrayIterator does not clone itself) +--FILE-- + +===DONE=== +--EXPECT-- +int(1) +int(1) +int(1) +int(2) +int(1) +int(3) +===DONE===