From: Matthias Dötsch Date: Thu, 4 Jun 2020 16:58:41 +0000 (+0200) Subject: in_array() avoid internal property access as we have the arrlen already X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=957a0f6a695485d69dbcc0fe504633617972d252;p=php in_array() avoid internal property access as we have the arrlen already Closes GH-5662 --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 5138614858..1789dd52d2 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4024,7 +4024,7 @@ PHP_FUNCTION(array_values) } /* Initialize return array */ - array_init_size(return_value, zend_hash_num_elements(arrval)); + array_init_size(return_value, arrlen); zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); /* Go through input array and add values to the return array */