From: Nikita Popov Date: Thu, 29 May 2014 19:19:49 +0000 (+0200) Subject: Fix ArrayObject with immutable array X-Git-Tag: POST_PHPNG_MERGE~236^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c85aa0489671e6cec43406161c558567e5b7336;p=php Fix ArrayObject with immutable array --- diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 2fa7a53dd3..9420990d6c 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1146,6 +1146,9 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar if (Z_TYPE_P(array) == IS_ARRAY) { SEPARATE_ZVAL_IF_NOT_REF(array); } + if (Z_IMMUTABLE_P(array)) { + zval_copy_ctor(array); + } if (Z_TYPE_P(array) == IS_OBJECT && (Z_OBJ_HT_P(array) == &spl_handler_ArrayObject || Z_OBJ_HT_P(array) == &spl_handler_ArrayIterator)) { zval_ptr_dtor(&intern->array);