Skip to content

Commit a02f7f2

Browse files
committed
Use more appropriate types for php_array_walk() function
1 parent 376b1ef commit a02f7f2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/standard/array.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,16 +1387,16 @@ typedef struct {
13871387
zend_fcall_info_cache fci_cache;
13881388
} php_array_walk_context;
13891389

1390-
static int php_array_walk(
1391-
php_array_walk_context *context, zval *array, zval *userdata, int recursive)
1390+
static zend_result php_array_walk(
1391+
php_array_walk_context *context, zval *array, zval *userdata, bool recursive)
13921392
{
13931393
zval args[3], /* Arguments to userland function */
13941394
retval, /* Return value - unused */
13951395
*zv;
13961396
HashTable *target_hash = HASH_OF(array);
13971397
HashPosition pos;
13981398
uint32_t ht_iter;
1399-
int result = SUCCESS;
1399+
zend_result result = SUCCESS;
14001400

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

1541-
php_array_walk(&context, array, userdata, 0);
1541+
php_array_walk(&context, array, userdata, /* recursive */ false);
15421542
RETURN_TRUE;
15431543
}
15441544
/* }}} */
@@ -1557,7 +1557,7 @@ PHP_FUNCTION(array_walk_recursive)
15571557
Z_PARAM_ZVAL(userdata)
15581558
ZEND_PARSE_PARAMETERS_END();
15591559

1560-
php_array_walk(&context, array, userdata, 1);
1560+
php_array_walk(&context, array, userdata, /* recursive */ true);
15611561
RETURN_TRUE;
15621562
}
15631563
/* }}} */

0 commit comments

Comments
 (0)