From f4d15d822667ef0d26f41d7199ad99e7becc2543 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Mon, 1 Nov 2010 17:16:47 +0000 Subject: [PATCH] - Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4) --- NEWS | 2 ++ ext/standard/array.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 3dcbaa13cc..22ff2a1eac 100644 --- a/NEWS +++ b/NEWS @@ -160,6 +160,8 @@ - Fixed bug #49215 (make fails on glob_wrapper). (Felipe) - Fixed bug #48831 (php -i has different output to php --ini). (Richard, Pierre) +- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4). + (Felipe) - Fixed bug #45921 (Can't initialize character set hebrew). (Andrey) - Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy with SoapClient object). (Dmitry) diff --git a/ext/standard/array.c b/ext/standard/array.c index 501ced13cf..06d296e9e9 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3557,8 +3557,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ for (i = 1; i < arr_argc; i++) { Bucket **ptr = ptrs[i]; if (behavior == DIFF_NORMAL) { - while (*ptr && (0 < (c = diff_data_compare_func(ptrs[0], ptr TSRMLS_CC)))) { - ptr++; + while (*ptrs[i] && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) { + ptrs[i]++; } } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ while (*ptr && (0 != (c = diff_key_compare_func(ptrs[0], ptr TSRMLS_CC)))) { -- 2.40.0