From: Antony Dovgal Date: Wed, 23 Jan 2008 11:20:00 +0000 (+0000) Subject: fix #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL... X-Git-Tag: RELEASE_2_0_0a1~808 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6169ad7ca51f29d07dbc0ffc8108585bdb4090a;p=php fix #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values) patch by Felipe --- diff --git a/ext/standard/array.c b/ext/standard/array.c index e7345fc188..2a99e960f0 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2397,8 +2397,18 @@ ukey: SEPARATE_ZVAL(dest_entry); SEPARATE_ZVAL(src_entry); - convert_to_array_ex(dest_entry); - convert_to_array_ex(src_entry); + if (Z_TYPE_PP(dest_entry) == IS_NULL) { + convert_to_array_ex(dest_entry); + add_next_index_null(*dest_entry); + } else { + convert_to_array_ex(dest_entry); + } + if (Z_TYPE_PP(src_entry) == IS_NULL) { + convert_to_array_ex(src_entry); + add_next_index_null(*src_entry); + } else { + convert_to_array_ex(src_entry); + } if (thash) { thash->nApplyCount++; }