- Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4)

This commit is contained in:
Felipe Pena 2010-11-01 17:16:47 +00:00
parent 5c09767d4b
commit 5d584d4737

View File

@ -3561,8 +3561,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)))) {