]> granicus.if.org Git - php/commitdiff
in_array() avoid internal property access as we have the arrlen already
authorMatthias Dötsch <matze@mdoetsch.de>
Thu, 4 Jun 2020 16:58:41 +0000 (18:58 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Thu, 4 Jun 2020 20:55:06 +0000 (22:55 +0200)
Closes GH-5662

ext/standard/array.c

index 51386148588edd92e6b952dfd5256ababa5f6d09..1789dd52d248cc1c20ed99409956c7f15fb6108c 100644 (file)
@@ -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 */