From d5a5276a04a79edcacf302a6bfee3801ca0c0923 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 4 Aug 2022 12:48:20 +0200 Subject: [PATCH] Avoid unnecessary comparison The first element of the `arrays` serves as base for the comparison, so there is no need to compare it to itself. --- ext/standard/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index cf34085e14b7f..c1d33ee2c42dc 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -5718,7 +5718,7 @@ PHP_FUNCTION(array_multisort) /* Make sure the arrays are of the same size. */ array_size = zend_hash_num_elements(Z_ARRVAL_P(arrays[0])); - for (i = 0; i < num_arrays; i++) { + for (i = 1; i < num_arrays; i++) { if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != (uint32_t)array_size) { zend_value_error("Array sizes are inconsistent"); MULTISORT_ABORT;