From f6169ad7ca51f29d07dbc0ffc8108585bdb4090a Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 23 Jan 2008 11:20:00 +0000 Subject: [PATCH] fix #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values) patch by Felipe --- ext/standard/array.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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++; } -- 2.50.1