From ac099ca676fb97df2ead41be379f360aca31a86c Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 1 Apr 2006 22:39:42 +0000 Subject: [PATCH] - Bugfix #36941 (ArrayIterator does not clone itself) --- ext/spl/spl_array.c | 1 + ext/spl/tests/bug36941.phpt | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 ext/spl/tests/bug36941.phpt 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=== -- 2.50.1