From 31a3c871599ea66d70ce1b9fc7c24da922d3cca0 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 5 Oct 2003 19:37:02 +0000 Subject: [PATCH] Fixed clobbering of the source array, when merging complex multi-dimensional arrays. Bug reported by Lukas Smith. --- ext/standard/array.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/standard/array.c b/ext/standard/array.c index 5c21de896f..af0060b8cd 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2168,6 +2168,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), -- 2.50.1