]> granicus.if.org Git - php/commitdiff
MFH: Fixed clobbering of the source array, when merging complex
authorIlia Alshanetsky <iliaa@php.net>
Sun, 5 Oct 2003 19:37:06 +0000 (19:37 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 5 Oct 2003 19:37:06 +0000 (19:37 +0000)
multi-dimensional arrays. Bug reported by Lukas Smith.

ext/standard/array.c

index 1d76cc82250e3bf646d67bba4767680d5a9df0a3..d78943f65b381486791eea9f04b8552539cda0b1 100644 (file)
@@ -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),