tony2001 Wed Jan 23 11:20:00 2008 UTC
Modified files:
/php-src/ext/standard array.c
Log:
fix #43559 (array_merge_recursive() doesn't behave as expected with duplicate
NULL values)
patch by Felipe
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.435&r2=1.436&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.435 php-src/ext/standard/array.c:1.436
--- php-src/ext/standard/array.c:1.435 Mon Jan 14 22:08:00 2008
+++ php-src/ext/standard/array.c Wed Jan 23 11:20:00 2008
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.435 2008/01/14 22:08:00 shire Exp $ */
+/* $Id: array.c,v 1.436 2008/01/23 11:20:00 tony2001 Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -2397,8 +2397,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++;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php