-
-
Save cmb69/69937eeeefbcd37360a891256500bf4c to your computer and use it in GitHub Desktop.
quick fix for array_diff_uassoc() (https://3v4l.org/GWoNH)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ext/standard/array.c | 3 +++ | |
1 file changed, 3 insertions(+) | |
diff --git a/ext/standard/array.c b/ext/standard/array.c | |
index aa89e3755b..4f9d3e54f0 100644 | |
--- a/ext/standard/array.c | |
+++ b/ext/standard/array.c | |
@@ -5320,6 +5320,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ | |
ptrs[i]++; | |
} | |
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ | |
+more: | |
while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr)))) { | |
ptr++; | |
} | |
@@ -5345,6 +5346,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ | |
BG(user_compare_fci) = *fci_key; | |
BG(user_compare_fci_cache) = *fci_key_cache; | |
} | |
+ ptr++; | |
+ goto more; | |
} else { | |
break; | |
/* we have found the element in other arrays thus we don't want it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment