summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index af9734d3d7..078b84ab8f 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -705,17 +705,11 @@ PHP_FUNCTION(krsort)
zend_long sort_type = PHP_SORT_REGULAR;
compare_func_t cmp;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
- RETURN_FALSE;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_ARRAY_EX(array, 0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(sort_type)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
-#endif
cmp = php_get_key_compare_func(sort_type, 1);
@@ -734,17 +728,11 @@ PHP_FUNCTION(ksort)
zend_long sort_type = PHP_SORT_REGULAR;
compare_func_t cmp;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
- RETURN_FALSE;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_ARRAY_EX(array, 0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(sort_type)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
-#endif
cmp = php_get_key_compare_func(sort_type, 0);
@@ -794,17 +782,11 @@ PHP_FUNCTION(count)
zend_long cnt;
zval *element;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &array, &mode) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_ZVAL(array)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(mode)
ZEND_PARSE_PARAMETERS_END();
-#endif
switch (Z_TYPE_P(array)) {
case IS_NULL:
@@ -1135,15 +1117,9 @@ PHP_FUNCTION(end)
HashTable *array;
zval *entry;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
zend_hash_internal_pointer_end(array);
@@ -1169,15 +1145,9 @@ PHP_FUNCTION(prev)
HashTable *array;
zval *entry;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
zend_hash_move_backwards(array);
@@ -1203,15 +1173,9 @@ PHP_FUNCTION(next)
HashTable *array;
zval *entry;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
zend_hash_move_forward(array);
@@ -1237,15 +1201,9 @@ PHP_FUNCTION(reset)
HashTable *array;
zval *entry;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
zend_hash_internal_pointer_reset(array);
@@ -1271,15 +1229,9 @@ PHP_FUNCTION(current)
HashTable *array;
zval *entry;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_OR_OBJECT_HT(array)
ZEND_PARSE_PARAMETERS_END();
-#endif
if ((entry = zend_hash_get_current_data(array)) == NULL) {
RETURN_FALSE;
@@ -1300,15 +1252,9 @@ PHP_FUNCTION(key)
{
HashTable *array;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_OR_OBJECT_HT(array)
ZEND_PARSE_PARAMETERS_END();
-#endif
zend_hash_get_current_key_zval(array, return_value);
}
@@ -1550,13 +1496,6 @@ PHP_FUNCTION(array_walk)
orig_array_walk_fci = BG(array_walk_fci);
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "A/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
- BG(array_walk_fci) = orig_array_walk_fci;
- BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ARRAY_OR_OBJECT_EX(array, 0, 1)
Z_PARAM_FUNC(BG(array_walk_fci), BG(array_walk_fci_cache))
@@ -1567,7 +1506,6 @@ PHP_FUNCTION(array_walk)
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
return
);
-#endif
php_array_walk(array, userdata, 0);
BG(array_walk_fci) = orig_array_walk_fci;
@@ -1614,18 +1552,12 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior)
zend_string *str_idx;
zend_bool strict = 0; /* strict comparison or not */
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "za|b", &value, &array, &strict) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(value)
Z_PARAM_ARRAY(array)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(strict)
ZEND_PARSE_PARAMETERS_END();
-#endif
if (strict) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
@@ -1799,18 +1731,12 @@ PHP_FUNCTION(extract)
zend_array *symbol_table;
zval var_array;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|lz/", &var_array_param, &extract_type, &prefix) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 3)
Z_PARAM_ARRAY(var_array_param)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(extract_type)
Z_PARAM_ZVAL_EX(prefix, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
extract_refs = (extract_type & EXTR_REFS);
if (extract_refs) {
@@ -2046,17 +1972,11 @@ PHP_FUNCTION(array_fill)
zval *val;
zend_long start_key, num;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "llz", &start_key, &num, &val) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(3, 3)
Z_PARAM_LONG(start_key)
Z_PARAM_LONG(num)
Z_PARAM_ZVAL(val)
ZEND_PARSE_PARAMETERS_END();
-#endif
if (EXPECTED(num > 0)) {
if (sizeof(num) > 4 && UNEXPECTED(EXPECTED(num > 0x7fffffff))) {
@@ -2646,15 +2566,9 @@ PHP_FUNCTION(array_pop)
uint32_t idx;
Bucket *p;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_EX(stack, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
if (zend_hash_num_elements(Z_ARRVAL_P(stack)) == 0) {
return;
@@ -2707,15 +2621,9 @@ PHP_FUNCTION(array_shift)
uint32_t idx;
Bucket *p;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY_EX(stack, 0, 1)
ZEND_PARSE_PARAMETERS_END();
-#endif
if (zend_hash_num_elements(Z_ARRVAL_P(stack)) == 0) {
return;
@@ -2958,11 +2866,6 @@ PHP_FUNCTION(array_slice)
zend_string *string_key;
zend_ulong num_key;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(2, 4)
Z_PARAM_ARRAY(input)
Z_PARAM_LONG(offset)
@@ -2970,7 +2873,6 @@ PHP_FUNCTION(array_slice)
Z_PARAM_ZVAL(z_length)
Z_PARAM_BOOL(preserve_keys)
ZEND_PARSE_PARAMETERS_END();
-#endif
/* Get number of entries in the input hash */
num_in = zend_hash_num_elements(Z_ARRVAL_P(input));
@@ -3239,15 +3141,9 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE
zval *arg;
int argc, i;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, -1)
Z_PARAM_VARIADIC('+', args, argc)
ZEND_PARSE_PARAMETERS_END();
-#endif
for (i = 0; i < argc; i++) {
zval *arg = args + i;
@@ -3379,18 +3275,12 @@ PHP_FUNCTION(array_keys)
zend_ulong num_idx;
zend_string *str_idx;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &input, &search_value, &strict) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 3)
Z_PARAM_ARRAY(input)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL(search_value)
Z_PARAM_BOOL(strict)
ZEND_PARSE_PARAMETERS_END();
-#endif
/* Initialize return array */
if (search_value != NULL) {
@@ -3448,15 +3338,9 @@ PHP_FUNCTION(array_values)
zval *input, /* Input array */
*entry; /* An entry in the input array */
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY(input)
ZEND_PARSE_PARAMETERS_END();
-#endif
/* Initialize return array */
array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_P(input)));
@@ -5433,16 +5317,10 @@ PHP_FUNCTION(array_map)
int i;
uint32_t k, maxlen = 0;
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(2, -1)
Z_PARAM_FUNC_EX(fci, fci_cache, 1, 0)
Z_PARAM_VARIADIC('+', arrays, n_arrays)
ZEND_PARSE_PARAMETERS_END();
-#endif
RETVAL_NULL();
@@ -5591,16 +5469,10 @@ PHP_FUNCTION(array_key_exists)
zval *key; /* key to check for */
HashTable *array; /* array to check in */
-#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zH", &key, &array) == FAILURE) {
- return;
- }
-#else
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_ZVAL(key)
Z_PARAM_ARRAY_OR_OBJECT_HT(array)
ZEND_PARSE_PARAMETERS_END();
-#endif
switch (Z_TYPE_P(key)) {
case IS_STRING: