diff options
| author | Antony Dovgal <tony2001@php.net> | 2008-01-23 12:09:52 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2008-01-23 12:09:52 +0000 |
| commit | 67c8d8d95ede1fcbf71ed7f9fdc7b43ce2b17f64 (patch) | |
| tree | 47f9129190e5985553d320b64c263164c6dfe6cc /ext/standard/array.c | |
| parent | d008f576b0327f5fbae8a1a646300fa640b9bdbd (diff) | |
| download | php-git-67c8d8d95ede1fcbf71ed7f9fdc7b43ce2b17f64.tar.gz | |
MFH: fix #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values)
patch by Felipe
Diffstat (limited to 'ext/standard/array.c')
| -rw-r--r-- | ext/standard/array.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index c7f2c3a30a..9283de508a 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2197,8 +2197,18 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS 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++; } |
