@@ -3806,7 +3806,7 @@ PHP_FUNCTION(array_splice)
38063806 /* ..and the length */
38073807 if (length < 0 ) {
38083808 size = num_in - offset + length ;
3809- } else if (((zend_ulong ) offset + (zend_ulong ) length ) > ( uint32_t ) num_in ) {
3809+ } else if (((zend_ulong ) offset + (zend_ulong ) length ) > num_in ) {
38103810 size = num_in - offset ;
38113811 }
38123812
@@ -6729,12 +6729,11 @@ PHP_FUNCTION(array_all)
67296729PHP_FUNCTION (array_map )
67306730{
67316731 zval * arrays = NULL ;
6732- int n_arrays = 0 ;
6732+ uint32_t n_arrays = 0 ;
67336733 zval result ;
67346734 zend_fcall_info fci = empty_fcall_info ;
67356735 zend_fcall_info_cache fci_cache = empty_fcall_info_cache ;
6736- int i ;
6737- uint32_t k , maxlen = 0 ;
6736+ uint32_t maxlen = 0 ;
67386737
67396738 ZEND_PARSE_PARAMETERS_START (2 , -1 )
67406739 Z_PARAM_FUNC_OR_NULL (fci , fci_cache )
@@ -6745,7 +6744,6 @@ PHP_FUNCTION(array_map)
67456744 zend_ulong num_key ;
67466745 zend_string * str_key ;
67476746 zval * zv , arg ;
6748- int ret ;
67496747
67506748 if (Z_TYPE (arrays [0 ]) != IS_ARRAY ) {
67516749 zend_argument_type_error (2 , "must be of type array, %s given" , zend_zval_value_name (& arrays [0 ]));
@@ -6767,7 +6765,7 @@ PHP_FUNCTION(array_map)
67676765 fci .params = & arg ;
67686766
67696767 ZVAL_COPY (& arg , zv );
6770- ret = zend_call_function (& fci , & fci_cache );
6768+ zend_result ret = zend_call_function (& fci , & fci_cache );
67716769 i_zval_ptr_dtor (& arg );
67726770 if (ret != SUCCESS || Z_TYPE (result ) == IS_UNDEF ) {
67736771 zend_array_destroy (Z_ARR_P (return_value ));
@@ -6782,7 +6780,7 @@ PHP_FUNCTION(array_map)
67826780 } else {
67836781 uint32_t * array_pos = (HashPosition * )ecalloc (n_arrays , sizeof (HashPosition ));
67846782
6785- for (i = 0 ; i < n_arrays ; i ++ ) {
6783+ for (uint32_t i = 0 ; i < n_arrays ; i ++ ) {
67866784 if (Z_TYPE (arrays [i ]) != IS_ARRAY ) {
67876785 zend_argument_type_error (i + 2 , "must be of type array, %s given" , zend_zval_value_name (& arrays [i ]));
67886786 efree (array_pos );
@@ -6799,13 +6797,13 @@ PHP_FUNCTION(array_map)
67996797 zval zv ;
68006798
68016799 /* We iterate through all the arrays at once. */
6802- for (k = 0 ; k < maxlen ; k ++ ) {
6800+ for (uint32_t k = 0 ; k < maxlen ; k ++ ) {
68036801
68046802 /* If no callback, the result will be an array, consisting of current
68056803 * entries from all arrays. */
68066804 array_init_size (& result , n_arrays );
68076805
6808- for (i = 0 ; i < n_arrays ; i ++ ) {
6806+ for (uint32_t i = 0 ; i < n_arrays ; i ++ ) {
68096807 /* If this array still has elements, add the current one to the
68106808 * parameter list, otherwise use null value. */
68116809 uint32_t pos = array_pos [i ];
@@ -6843,8 +6841,8 @@ PHP_FUNCTION(array_map)
68436841 zval * params = (zval * )safe_emalloc (n_arrays , sizeof (zval ), 0 );
68446842
68456843 /* We iterate through all the arrays at once. */
6846- for (k = 0 ; k < maxlen ; k ++ ) {
6847- for (i = 0 ; i < n_arrays ; i ++ ) {
6844+ for (uint32_t k = 0 ; k < maxlen ; k ++ ) {
6845+ for (uint32_t i = 0 ; i < n_arrays ; i ++ ) {
68486846 /* If this array still has elements, add the current one to the
68496847 * parameter list, otherwise use null value. */
68506848 uint32_t pos = array_pos [i ];
@@ -6882,13 +6880,13 @@ PHP_FUNCTION(array_map)
68826880 if (zend_call_function (& fci , & fci_cache ) != SUCCESS || Z_TYPE (result ) == IS_UNDEF ) {
68836881 efree (array_pos );
68846882 zend_array_destroy (Z_ARR_P (return_value ));
6885- for (i = 0 ; i < n_arrays ; i ++ ) {
6883+ for (uint32_t i = 0 ; i < n_arrays ; i ++ ) {
68866884 zval_ptr_dtor (& params [i ]);
68876885 }
68886886 efree (params );
68896887 RETURN_NULL ();
68906888 } else {
6891- for (i = 0 ; i < n_arrays ; i ++ ) {
6889+ for (uint32_t i = 0 ; i < n_arrays ; i ++ ) {
68926890 zval_ptr_dtor (& params [i ]);
68936891 }
68946892 }
@@ -6947,7 +6945,6 @@ PHP_FUNCTION(array_key_exists)
69476945/* {{{ Split array into chunks */
69486946PHP_FUNCTION (array_chunk )
69496947{
6950- int num_in ;
69516948 zend_long size , current = 0 ;
69526949 zend_string * str_key ;
69536950 zend_ulong num_key ;
@@ -6969,7 +6966,7 @@ PHP_FUNCTION(array_chunk)
69696966 RETURN_THROWS ();
69706967 }
69716968
6972- num_in = zend_hash_num_elements (Z_ARRVAL_P (input ));
6969+ uint32_t num_in = zend_hash_num_elements (Z_ARRVAL_P (input ));
69736970
69746971 if (size > num_in ) {
69756972 if (num_in == 0 ) {
@@ -7021,15 +7018,14 @@ PHP_FUNCTION(array_combine)
70217018 HashTable * values , * keys ;
70227019 uint32_t pos_values = 0 ;
70237020 zval * entry_keys , * entry_values ;
7024- int num_keys , num_values ;
70257021
70267022 ZEND_PARSE_PARAMETERS_START (2 , 2 )
70277023 Z_PARAM_ARRAY_HT (keys )
70287024 Z_PARAM_ARRAY_HT (values )
70297025 ZEND_PARSE_PARAMETERS_END ();
70307026
7031- num_keys = zend_hash_num_elements (keys );
7032- num_values = zend_hash_num_elements (values );
7027+ uint32_t num_keys = zend_hash_num_elements (keys );
7028+ uint32_t num_values = zend_hash_num_elements (values );
70337029
70347030 if (num_keys != num_values ) {
70357031 zend_argument_value_error (1 , "and argument #2 ($values) must have the same number of elements" );
0 commit comments