From: Ilia Alshanetsky Date: Sun, 5 Oct 2003 19:37:06 +0000 (+0000) Subject: MFH: Fixed clobbering of the source array, when merging complex X-Git-Tag: php-4.3.4RC2~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a13710455c2a227349beb295ef2054d63fe8a3cf;p=php MFH: Fixed clobbering of the source array, when merging complex multi-dimensional arrays. Bug reported by Lukas Smith. --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 1d76cc8225..d78943f65b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2005,6 +2005,8 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS return 0; } SEPARATE_ZVAL(dest_entry); + SEPARATE_ZVAL(src_entry); + convert_to_array_ex(dest_entry); convert_to_array_ex(src_entry); if (!php_array_merge(Z_ARRVAL_PP(dest_entry),