]> granicus.if.org Git - php/commitdiff
- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4)
authorFelipe Pena <felipe@php.net>
Mon, 1 Nov 2010 17:16:47 +0000 (17:16 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 1 Nov 2010 17:16:47 +0000 (17:16 +0000)
NEWS
ext/standard/array.c

diff --git a/NEWS b/NEWS
index 3dcbaa13cc388762f189fc784a5dff40b931e9ec..22ff2a1eac1329926da0b0daa272b9a0dc4fc8cb 100644 (file)
--- a/NEWS
+++ b/NEWS
 - 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)
index 501ced13cfba82e4b212316a001be3225a04a50b..06d296e9e99a025c490b6b5060d279a4944d99ee 100644 (file)
@@ -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)))) {