Skip to content

Commit

Permalink
Use more appropriate types for php_array_walk() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Jun 6, 2023
1 parent 376b1ef commit a02f7f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ext/standard/array.c
Expand Up @@ -1387,16 +1387,16 @@ typedef struct {
zend_fcall_info_cache fci_cache;
} php_array_walk_context;

static int php_array_walk(
php_array_walk_context *context, zval *array, zval *userdata, int recursive)
static zend_result php_array_walk(
php_array_walk_context *context, zval *array, zval *userdata, bool recursive)
{
zval args[3], /* Arguments to userland function */
retval, /* Return value - unused */
*zv;
HashTable *target_hash = HASH_OF(array);
HashPosition pos;
uint32_t ht_iter;
int result = SUCCESS;
zend_result result = SUCCESS;

/* Create a local copy of fci, as we want to use different arguments at different
* levels of recursion. */
Expand Down Expand Up @@ -1538,7 +1538,7 @@ PHP_FUNCTION(array_walk)
Z_PARAM_ZVAL(userdata)
ZEND_PARSE_PARAMETERS_END();

php_array_walk(&context, array, userdata, 0);
php_array_walk(&context, array, userdata, /* recursive */ false);
RETURN_TRUE;
}
/* }}} */
Expand All @@ -1557,7 +1557,7 @@ PHP_FUNCTION(array_walk_recursive)
Z_PARAM_ZVAL(userdata)
ZEND_PARSE_PARAMETERS_END();

php_array_walk(&context, array, userdata, 1);
php_array_walk(&context, array, userdata, /* recursive */ true);
RETURN_TRUE;
}
/* }}} */
Expand Down

0 comments on commit a02f7f2

Please sign in to comment.