]> 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>
Thu, 11 Nov 2010 21:25:34 +0000 (21:25 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 11 Nov 2010 21:25:34 +0000 (21:25 +0000)
NEWS
ext/standard/array.c

diff --git a/NEWS b/NEWS
index 242c2e6e4cf328fa268a9ac69d787516a0e012d0..08f7bbcdb5994728f0c550e69f3081abcbc4dc2e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@
   (Sriram Natarajan)
 - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
 - Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry)
+- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4).
+  (Felipe)
 - Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy
   with SoapClient object). (Dmitry)
 
index db6bd762f0458d8a816be47a37febd4b6f93b56c..7bd012505c022f15c2d27518f245f0eecbb3bbfe 100644 (file)
@@ -3842,8 +3842,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)))) {