From 476013cebd25be271529ba888d07245c92e6b73f Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 5 Oct 2004 18:37:17 +0000 Subject: [PATCH] - Use ZEND_ARG_SEND_AUTOMATIC for several array functions --- ext/standard/basic_functions.c | 64 +++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 1eef4d9599..fa1a9a1166 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -143,6 +143,22 @@ static ZEND_ARG_PASS_INFO(1) ZEND_END_ARG_INFO() +static + ZEND_BEGIN_ARG_INFO(all_args_auto_ref, 0) + ZEND_ARG_PASS_INFO(4) + ZEND_END_ARG_INFO() + +static + ZEND_BEGIN_ARG_INFO(first_arg_auto_ref, 0) + ZEND_ARG_PASS_INFO(4) + ZEND_END_ARG_INFO() + +static + ZEND_BEGIN_ARG_INFO(first_and_second_args_auto_ref, 0) + ZEND_ARG_PASS_INFO(4) + ZEND_ARG_PASS_INFO(4) + ZEND_END_ARG_INFO() + typedef struct _php_shutdown_function_entry { zval **arguments; int arg_count; @@ -764,8 +780,8 @@ function_entry basic_functions[] = { PHP_FE(key, first_arg_force_ref) PHP_FE(min, NULL) PHP_FE(max, NULL) - PHP_FE(in_array, NULL) - PHP_FE(array_search, NULL) + PHP_FE(in_array, first_and_second_args_auto_ref) + PHP_FE(array_search, first_and_second_args_auto_ref) PHP_FE(extract, NULL) PHP_FE(compact, NULL) PHP_FE(array_fill, NULL) @@ -777,8 +793,8 @@ function_entry basic_functions[] = { PHP_FE(array_unshift, first_arg_force_ref) PHP_FE(array_splice, first_arg_force_ref) PHP_FE(array_slice, NULL) - PHP_FE(array_merge, NULL) - PHP_FE(array_merge_recursive, NULL) + PHP_FE(array_merge, all_args_auto_ref) + PHP_FE(array_merge_recursive, all_args_auto_ref) PHP_FE(array_keys, NULL) PHP_FE(array_values, NULL) PHP_FE(array_count_values, NULL) @@ -789,33 +805,33 @@ function_entry basic_functions[] = { PHP_FE(array_change_key_case, NULL) PHP_FE(array_rand, NULL) PHP_FE(array_unique, NULL) - PHP_FE(array_intersect, NULL) - PHP_FE(array_intersect_key, NULL) - PHP_FE(array_intersect_ukey, NULL) - PHP_FE(array_uintersect, NULL) - PHP_FE(array_intersect_assoc, NULL) - PHP_FE(array_uintersect_assoc, NULL) - PHP_FE(array_intersect_uassoc, NULL) - PHP_FE(array_uintersect_uassoc, NULL) - PHP_FE(array_diff, NULL) - PHP_FE(array_diff_key, NULL) - PHP_FE(array_diff_ukey, NULL) - PHP_FE(array_udiff, NULL) - PHP_FE(array_diff_assoc, NULL) - PHP_FE(array_udiff_assoc, NULL) - PHP_FE(array_diff_uassoc, NULL) - PHP_FE(array_udiff_uassoc, NULL) - PHP_FE(array_sum, NULL) - PHP_FE(array_filter, NULL) + PHP_FE(array_intersect, all_args_auto_ref) + PHP_FE(array_intersect_key, all_args_auto_ref) + PHP_FE(array_intersect_ukey, all_args_auto_ref) + PHP_FE(array_uintersect, all_args_auto_ref) + PHP_FE(array_intersect_assoc, all_args_auto_ref) + PHP_FE(array_uintersect_assoc, all_args_auto_ref) + PHP_FE(array_intersect_uassoc, all_args_auto_ref) + PHP_FE(array_uintersect_uassoc, all_args_auto_ref) + PHP_FE(array_diff, all_args_auto_ref) + PHP_FE(array_diff_key, all_args_auto_ref) + PHP_FE(array_diff_ukey, all_args_auto_ref) + PHP_FE(array_udiff, all_args_auto_ref) + PHP_FE(array_diff_assoc, all_args_auto_ref) + PHP_FE(array_udiff_assoc, all_args_auto_ref) + PHP_FE(array_diff_uassoc, all_args_auto_ref) + PHP_FE(array_udiff_uassoc, all_args_auto_ref) + PHP_FE(array_sum, first_arg_auto_ref) + PHP_FE(array_filter, first_arg_auto_ref) PHP_FE(array_map, NULL) PHP_FE(array_chunk, NULL) PHP_FE(array_combine, NULL) - PHP_FE(array_key_exists, NULL) + PHP_FE(array_key_exists, first_and_second_args_auto_ref) /* aliases from array.c */ PHP_FALIAS(pos, current, first_arg_force_ref) PHP_FALIAS(sizeof, count, NULL) - PHP_FALIAS(key_exists, array_key_exists, NULL) + PHP_FALIAS(key_exists, array_key_exists, first_and_second_args_auto_ref) /* functions from assert.c */ PHP_FE(assert, NULL) -- 2.50.1