felipe Wed Feb 27 02:04:09 2008 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard array.c /php-src/ext/standard/tests/array array_merge_recursive_variation5.phpt /php-src NEWS Log: MFB: Fixed bug #43559 (array_merge_recursive() doesn't behave as expected with duplicate NULL values) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.53&r2=1.308.2.21.2.54&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.53 php-src/ext/standard/array.c:1.308.2.21.2.54 --- php-src/ext/standard/array.c:1.308.2.21.2.53 Fri Feb 15 09:33:26 2008 +++ php-src/ext/standard/array.c Wed Feb 27 02:04:08 2008 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.308.2.21.2.53 2008/02/15 09:33:26 tony2001 Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.54 2008/02/27 02:04:08 felipe Exp $ */ #include "php.h" #include "php_ini.h" @@ -2312,8 +2312,18 @@ 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++; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_merge_recursive_variation5.phpt?r1=1.1.4.2&r2=1.1.4.3&diff_format=u Index: php-src/ext/standard/tests/array/array_merge_recursive_variation5.phpt diff -u php-src/ext/standard/tests/array/array_merge_recursive_variation5.phpt:1.1.4.2 php-src/ext/standard/tests/array/array_merge_recursive_variation5.phpt:1.1.4.3 --- php-src/ext/standard/tests/array/array_merge_recursive_variation5.phpt:1.1.4.2 Tue Dec 11 09:09:12 2007 +++ php-src/ext/standard/tests/array/array_merge_recursive_variation5.phpt Wed Feb 27 02:04:08 2008 @@ -374,8 +374,10 @@ object(classA)#%d (0) { } ["string"]=> - array(1) { + array(2) { [0]=> + NULL + [1]=> string(5) "hello" } ["resource"]=> http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1099&r2=1.2027.2.547.2.1100&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1099 php-src/NEWS:1.2027.2.547.2.1100 --- php-src/NEWS:1.2027.2.547.2.1099 Wed Feb 27 00:32:39 2008 +++ php-src/NEWS Wed Feb 27 02:04:09 2008 @@ -79,6 +79,8 @@ - Fixed bug #43589 (a possible infinite loop in bz2_filter.c). (Greg) - Fixed bug #43580 (removed bogus declaration of a non-existent php_is_url() function). (Ilia) +- Fixed bug #43559 (array_merge_recursive() doesn't behave as expected with + duplicate NULL values). (Felipe, Tony) - Fixed bug #43533 (escapeshellarg('') returns null). (Ilia) - Fixed bug #43527 (DateTime created from a timestamp reports environment timezone). (Derick)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php