46#define DIFF_COMP_DATA_NONE -1
47#define DIFF_COMP_DATA_INTERNAL 0
48#define DIFF_COMP_DATA_USER 1
49#define DIFF_COMP_KEY_INTERNAL 0
50#define DIFF_COMP_KEY_USER 1
52#define INTERSECT_NORMAL 1
53#define INTERSECT_KEY 2
54#define INTERSECT_ASSOC 6
55#define INTERSECT_COMP_DATA_NONE -1
56#define INTERSECT_COMP_DATA_INTERNAL 0
57#define INTERSECT_COMP_DATA_USER 1
58#define INTERSECT_COMP_KEY_INTERNAL 0
59#define INTERSECT_COMP_KEY_USER 1
65static void php_array_init_globals(zend_array_globals *array_globals)
67 memset(array_globals, 0,
sizeof(zend_array_globals));
82 ts_free_id(array_globals_id);
99#define RETURN_STABLE_SORT(a, b, result) do { \
100 int _result = (result); \
101 if (EXPECTED(_result)) { \
104 return stable_sort_fallback((a), (b)); \
108#define DEFINE_SORT_VARIANTS(name) \
109 static zend_never_inline int php_array_##name##_unstable(Bucket *a, Bucket *b) { \
110 return php_array_##name##_unstable_i(a, b); \
112 static zend_never_inline int php_array_##name(Bucket *a, Bucket *b) { \
113 RETURN_STABLE_SORT(a, b, php_array_##name##_unstable_i(a, b)); \
115 static zend_never_inline int php_array_reverse_##name##_unstable(Bucket *a, Bucket *b) { \
116 return php_array_##name##_unstable(a, b) * -1; \
118 static zend_never_inline int php_array_reverse_##name(Bucket *a, Bucket *b) { \
119 RETURN_STABLE_SORT(a, b, php_array_reverse_##name##_unstable(a, b)); \
129 }
else if (f->
key &&
s->key) {
178 s1 = zend_print_long_to_buf(buf1 +
sizeof(buf1) - 1, f->
h);
179 l1 = buf1 +
sizeof(buf1) - 1 - s1;
185 s2 = zend_print_long_to_buf(buf2 +
sizeof(buf2) - 1,
s->h);
186 l2 = buf2 +
sizeof(buf2) - 1 - s2;
203 s1 = zend_print_long_to_buf(buf1 +
sizeof(buf1) - 1, f->
h);
204 l1 = buf1 +
sizeof(buf1) - 1 - s1;
210 s2 = zend_print_long_to_buf(buf2 +
sizeof(buf2) - 1,
s->h);
211 l2 = buf2 +
sizeof(buf2) - 1 - s2;
217static int php_array_key_compare_string_natural_general(
Bucket *f,
Bucket *
s,
int fold_case)
228 s1 = zend_print_long_to_buf(buf1 +
sizeof(buf1) - 1, f->
h);
229 l1 = buf1 +
sizeof(buf1) - 1 - s1;
235 s2 = zend_print_long_to_buf(buf2 +
sizeof(buf2) - 1,
s->h);
236 l2 = buf2 +
sizeof(buf2) - 1 - s2;
242static int php_array_key_compare_string_natural_case(
Bucket *
a,
Bucket *b)
248static int php_array_reverse_key_compare_string_natural_case(
Bucket *
a,
Bucket *b)
254static int php_array_key_compare_string_natural(
Bucket *
a,
Bucket *b)
260static int php_array_reverse_key_compare_string_natural(
Bucket *
a,
Bucket *b)
275 s1 = zend_print_long_to_buf(buf1 +
sizeof(buf1) - 1, f->
h);
280 s2 = zend_print_long_to_buf(buf2 +
sizeof(buf2) - 1,
s->h);
300 uintptr_t lhs_uintptr = (uintptr_t)
Z_OBJ_P(lhs);
301 uintptr_t rhs_uintptr = (uintptr_t)
Z_OBJ_P(rhs);
302 return lhs_uintptr == rhs_uintptr ? 0 : (lhs_uintptr < rhs_uintptr ? -1 : 1);
330static int php_array_natural_general_compare(
Bucket *f,
Bucket *
s,
int fold_case)
334 zend_string *str2 = zval_get_tmp_string(&
s->val, &tmp_str2);
338 zend_tmp_string_release(tmp_str1);
339 zend_tmp_string_release(tmp_str2);
346 return php_array_natural_general_compare(
a, b, 0);
352 return php_array_natural_general_compare(
a, b, 1);
356static int php_array_data_compare_string_locale_unstable_i(
Bucket *f,
Bucket *
s)
380 return php_array_reverse_key_compare_numeric;
382 return php_array_key_compare_numeric;
389 return php_array_reverse_key_compare_string_case;
391 return php_array_key_compare_string_case;
395 return php_array_reverse_key_compare_string;
397 return php_array_key_compare_string;
405 return php_array_reverse_key_compare_string_natural_case;
407 return php_array_key_compare_string_natural_case;
411 return php_array_reverse_key_compare_string_natural;
413 return php_array_key_compare_string_natural;
420 return php_array_reverse_key_compare_string_locale;
422 return php_array_key_compare_string_locale;
429 return php_array_reverse_key_compare;
431 return php_array_key_compare;
444 return php_array_reverse_data_compare_numeric;
446 return php_array_data_compare_numeric;
453 return php_array_reverse_data_compare_string_case;
455 return php_array_data_compare_string_case;
459 return php_array_reverse_data_compare_string;
461 return php_array_data_compare_string;
469 return php_array_reverse_natural_case_compare;
471 return php_array_natural_case_compare;
475 return php_array_reverse_natural_compare;
477 return php_array_natural_compare;
484 return php_array_reverse_data_compare_string_locale;
486 return php_array_data_compare_string_locale;
493 return php_array_reverse_data_compare;
495 return php_array_data_compare;
508 return php_array_reverse_data_compare_numeric_unstable;
510 return php_array_data_compare_numeric_unstable;
517 return php_array_reverse_data_compare_string_case_unstable;
519 return php_array_data_compare_string_case_unstable;
523 return php_array_reverse_data_compare_string_unstable;
525 return php_array_data_compare_string_unstable;
533 return php_array_reverse_natural_case_compare_unstable;
535 return php_array_natural_case_compare_unstable;
539 return php_array_reverse_natural_compare_unstable;
541 return php_array_natural_compare_unstable;
548 return php_array_reverse_data_compare_string_locale_unstable;
550 return php_array_data_compare_string_locale_unstable;
557 return php_array_reverse_data_compare_unstable;
559 return php_array_data_compare_unstable;
580 cmp = php_get_key_compare_func(sort_type, 1);
601 cmp = php_get_key_compare_func(sort_type, 0);
622 cnt = zend_hash_num_elements(
ht);
656 cnt = zend_hash_num_elements(
Z_ARRVAL_P(array));
666 if (
zobj->handlers->count_elements) {
678 zend_call_known_instance_method_with_0_params(count_fn,
zobj, &
retval);
703 zend_array_sort(
Z_ARRVAL_P(array), php_array_natural_case_compare, 0);
705 zend_array_sort(
Z_ARRVAL_P(array), php_array_natural_compare, 0);
739 cmp = php_get_data_compare_func(sort_type, 0);
760 cmp = php_get_data_compare_func(sort_type, 1);
781 cmp = php_get_data_compare_func(sort_type, 0);
802 cmp = php_get_data_compare_func(sort_type, 1);
810static inline int php_array_user_compare_unstable(
Bucket *f,
Bucket *
s)
819 BG(user_compare_fci).param_count = 2;
820 BG(user_compare_fci).params =
args;
821 BG(user_compare_fci).retval = &
retval;
832 "Returning bool from comparison function is deprecated, "
833 "return an integer less than, equal to, or greater than zero");
866#define PHP_ARRAY_CMP_FUNC_VARS \
867 zend_fcall_info old_user_compare_fci; \
868 zend_fcall_info_cache old_user_compare_fci_cache \
870#define PHP_ARRAY_CMP_FUNC_BACKUP() \
871 old_user_compare_fci = BG(user_compare_fci); \
872 old_user_compare_fci_cache = BG(user_compare_fci_cache); \
873 ARRAYG(compare_deprecation_thrown) = 0; \
874 BG(user_compare_fci_cache) = empty_fcall_info_cache; \
876#define PHP_ARRAY_CMP_FUNC_RESTORE() \
877 BG(user_compare_fci) = old_user_compare_fci; \
878 BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
894 if (zend_hash_num_elements(arr) == 0) {
928static inline int php_array_user_key_compare_unstable(
Bucket *f,
Bucket *
s)
939 if (
s->key ==
NULL) {
945 BG(user_compare_fci).param_count = 2;
946 BG(user_compare_fci).params =
args;
947 BG(user_compare_fci).retval = &
retval;
958 "Returning bool from comparison function is deprecated, "
959 "return an integer less than, equal to, or greater than zero");
965 if (
s->key ==
NULL) {
1024 return zobj->handlers->get_properties(
zobj);
1027static zval *php_array_iter_seek_current(
HashTable *array,
bool forward_direction)
1032 if ((entry = zend_hash_get_current_data(array)) ==
NULL) {
1041 if (forward_direction) {
1042 result = zend_hash_move_forward(array);
1044 result = zend_hash_move_backwards(array);
1059 zval *entry = php_array_iter_seek_current(array, forward_direction);
1076 HashTable *array = get_ht_for_iap(array_zv,
true);
1077 if (zend_hash_num_elements(array) == 0) {
1081 zend_hash_internal_pointer_end(array);
1084 php_array_iter_return_current(
return_value, array,
false);
1098 HashTable *array = get_ht_for_iap(array_zv,
true);
1099 if (zend_hash_num_elements(array) == 0) {
1103 zend_hash_move_backwards(array);
1106 php_array_iter_return_current(
return_value, array,
false);
1120 HashTable *array = get_ht_for_iap(array_zv,
true);
1121 if (zend_hash_num_elements(array) == 0) {
1125 zend_hash_move_forward(array);
1128 php_array_iter_return_current(
return_value, array,
true);
1142 HashTable *array = get_ht_for_iap(array_zv,
true);
1143 if (zend_hash_num_elements(array) == 0) {
1147 zend_hash_internal_pointer_reset(array);
1150 php_array_iter_return_current(
return_value, array,
true);
1164 HashTable *array = get_ht_for_iap(array_zv,
false);
1165 php_array_iter_return_current(
return_value, array,
true);
1178 HashTable *array = get_ht_for_iap(array_zv,
false);
1179 zval *entry = php_array_iter_seek_current(array,
true);
1186static int php_data_compare(
const void *f,
const void *
s)
1231 for (i = 1; i < argc; i++) {
1237 }
else if (
Z_TYPE(
args[i]) ==
IS_DOUBLE && (zend_dval_to_lval((
double) min_lval) == min_lval)) {
1239 min_dval = (double) min_lval;
1240 goto double_compare;
1242 goto generic_compare;
1250 for (i = 1; i < argc; i++) {
1264 goto generic_compare;
1268 for (i = 1; i < argc; i++) {
1295 }
else if (
Z_TYPE_P(rhs) ==
IS_DOUBLE && (zend_dval_to_lval((
double) lhs_lval) == lhs_lval)) {
1297 lhs_dval = (double) lhs_lval;
1298 goto double_compare;
1300 goto generic_compare;
1312 goto generic_compare;
1359 for (i = 1; i < argc; i++) {
1365 }
else if (
Z_TYPE(
args[i]) ==
IS_DOUBLE && (zend_dval_to_lval((
double) max_lval) == max_lval)) {
1367 max_dval = (double) max_lval;
1368 goto double_compare;
1370 goto generic_compare;
1378 for (i = 1; i < argc; i++) {
1392 goto generic_compare;
1396 for (i = 1; i < argc; i++) {
1423 }
else if (
Z_TYPE_P(rhs) ==
IS_DOUBLE && (zend_dval_to_lval((
double) lhs_lval) == lhs_lval)) {
1425 lhs_dval = (double) lhs_lval;
1426 goto double_compare;
1428 goto generic_compare;
1440 goto generic_compare;
1468 if (zend_hash_num_elements(target_hash) == 0) {
1504 zend_get_typed_property_info_for_slot(
Z_OBJ_P(array),
zv);
1523 EG(ht_iterators)[ht_iter].pos =
pos;
1604 php_array_walk(&
context, array, userdata,
false);
1623 php_array_walk(&
context, array, userdata,
true);
1643 if (behavior == 0) {
1657 if (fast_is_identical_function(
value, entry)) {
1658 if (behavior == 0) {
1673 if (fast_equal_check_long(
value, entry)) {
1674 if (behavior == 0) {
1687 if (fast_equal_check_string(
value, entry)) {
1688 if (behavior == 0) {
1701 if (fast_equal_check_function(
value, entry)) {
1702 if (behavior == 0) {
1784 static const uint32_t
charset[8] = {
1786 0x00000000, 0x00000000, 0x87fffffe, 0x07fffffe,
1787 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
1788 static const uint32_t charset2[8] = {
1790 0x00000000, 0x03ff0000, 0x87fffffe, 0x07fffffe,
1791 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
1801 ch = (uint32_t)((
unsigned char *)
var_name)[0];
1815 if (var_name_len > 1) {
1818 ch = (uint32_t)((
unsigned char *)
var_name)[i];
1831 }
while (++i < var_name_len);
1842 if (add_underscore) {
1856 zval *entry, *orig_var;
1902 zval *entry, *orig_var;
1946 zval *entry, *orig_var;
1998 zval *entry, *orig_var;
2043 zval *entry, *orig_var, final_name;
2069 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2090 zval_ptr_dtor_str(&final_name);
2102 zval *entry, *orig_var, final_name;
2123 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2144 zval_ptr_dtor_str(&final_name);
2156 zval *entry, *orig_var, final_name;
2186 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2207 zval_ptr_dtor_str(&final_name);
2233 zval *entry, *orig_var, final_name;
2258 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2279 zval_ptr_dtor_str(&final_name);
2303 zval *entry, *orig_var, final_name;
2317 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2338 zval_ptr_dtor_str(&final_name);
2350 zval *entry, *orig_var, final_name;
2364 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2385 zval_ptr_dtor_str(&final_name);
2397 zval *entry, *orig_var, final_name;
2405 zval_ptr_dtor_str(&final_name);
2416 zval_ptr_dtor_str(&final_name);
2420 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2440 zval_ptr_dtor_str(&final_name);
2452 zval *entry, *orig_var, final_name;
2460 zval_ptr_dtor_str(&final_name);
2471 zval_ptr_dtor_str(&final_name);
2475 if (zend_string_equals(
Z_STR(final_name),
ZSTR_KNOWN(ZEND_STR_THIS))) {
2495 zval_ptr_dtor_str(&final_name);
2506 zval *entry, *orig_var;
2554 zval *entry, *orig_var;
2593 zval *var_array_param;
2611 extract_type &= 0xff;
2630 if (zend_forbid_dynamic_call() ==
FAILURE) {
2635 ZEND_ASSERT(symbol_table &&
"A symbol table should always be available here");
2638 switch (extract_type) {
2640 count = php_extract_ref_if_exists(
Z_ARRVAL_P(var_array_param), symbol_table);
2643 count = php_extract_ref_overwrite(
Z_ARRVAL_P(var_array_param), symbol_table);
2658 count = php_extract_ref_skip(
Z_ARRVAL_P(var_array_param), symbol_table);
2664 ZVAL_COPY(&array_copy, var_array_param);
2665 switch (extract_type) {
2667 count = php_extract_if_exists(
Z_ARRVAL(array_copy), symbol_table);
2670 count = php_extract_overwrite(
Z_ARRVAL(array_copy), symbol_table);
2685 count = php_extract_skip(
Z_ARRVAL(array_copy), symbol_table);
2746 if (zend_forbid_dynamic_call() ==
FAILURE) {
2751 ZEND_ASSERT(symbol_table &&
"A symbol table should always be available here");
2785 zend_throw_error(
NULL,
"Cannot add element to the array as the next element is already occupied");
2803 while (start_key--) {
2855 zend_tmp_string_release(tmp_key);
2861#define RANGE_CHECK_DOUBLE_INIT_ARRAY(start, end, _step) do { \
2862 double __calc_size = ((start - end) / (_step)) + 1; \
2863 if (__calc_size >= (double)HT_MAX_SIZE) { \
2865 "The supplied range exceeds the maximum array size: start=%0.1f end=%0.1f step=%0.1f", end, start, (_step)); \
2868 size = (uint32_t)_php_math_round(__calc_size, 0, PHP_ROUND_HALF_UP); \
2869 array_init_size(return_value, size); \
2870 zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); \
2873#define RANGE_CHECK_LONG_INIT_ARRAY(start, end, _step) do { \
2874 zend_ulong __calc_size = ((zend_ulong) start - end) / (_step); \
2875 if (__calc_size >= HT_MAX_SIZE - 1) { \
2877 "The supplied range exceeds the maximum array size: start=" ZEND_LONG_FMT " end=" ZEND_LONG_FMT " step=" ZEND_LONG_FMT, end, start, (_step)); \
2880 size = (uint32_t)(__calc_size + 1); \
2881 array_init_size(return_value, size); \
2882 zend_hash_real_init_packed(Z_ARRVAL_P(return_value)); \
2931 goto check_dval_value;
2934 *
dval = (double) *lval;
2960 zval *user_start, *user_end, *user_step =
NULL, tmp;
2961 bool is_step_double =
false;
2962 bool is_step_negative =
false;
2963 double step_double = 1.0;
2987 if (step_double < 0.0) {
2988 is_step_negative =
true;
2991 step = zend_dval_to_lval(step_double);
2992 if (!zend_is_long_compatible(step_double, step)) {
2993 is_step_double =
true;
3003 is_step_negative =
true;
3006 step_double = (double) step;
3008 if (step_double == 0.0) {
3015 double start_double;
3021 start_type = php_range_process_input(user_start, 1, &start_long, &start_double);
3022 if (start_type == 0) {
3025 end_type = php_range_process_input(user_end, 2, &end_long, &end_double);
3026 if (end_type == 0) {
3037 " argument #2 ($end) is a single byte string, argument #2 ($end) converted to 0");
3043 " argument #1 ($start) is a single byte string, argument #1 ($start) converted to 0");
3050 goto handle_numeric_inputs;
3053 if (is_step_double) {
3057 " of characters, inputs converted to 0");
3064 goto handle_numeric_inputs;
3068 unsigned char low = (
unsigned char)
Z_STRVAL_P(user_start)[0];
3069 unsigned char high = (
unsigned char)
Z_STRVAL_P(user_end)[0];
3073 if (low - high < step) {
3074 goto boundary_error;
3080 for (; low >= high; low -= (
unsigned int)step) {
3083 if (((
signed int)low - step) < 0) {
3088 }
else if (high > low) {
3089 if (is_step_negative) {
3090 goto negative_step_error;
3092 if (high - low < step) {
3093 goto boundary_error;
3098 for (; low <= high; low += (
unsigned int)step) {
3101 if (((
signed int)low + step) > 255) {
3114 handle_numeric_inputs:
3120 if (start_double > end_double) {
3121 if (start_double - end_double < step_double) {
3122 goto boundary_error;
3128 for (i = 0, element = start_double; i < size && element >= end_double; ++i, element = start_double - (i * step_double)) {
3133 }
else if (end_double > start_double) {
3134 if (is_step_negative) {
3135 goto negative_step_error;
3137 if (end_double - start_double < step_double) {
3138 goto boundary_error;
3144 for (i = 0, element = start_double; i <
size && element <= end_double; ++i, element = start_double + (i * step_double)) {
3161 if (start_long > end_long) {
3162 if ((
zend_ulong)start_long - end_long < unsigned_step) {
3163 goto boundary_error;
3169 for (i = 0; i <
size; ++i) {
3174 }
else if (end_long > start_long) {
3175 if (is_step_negative) {
3176 goto negative_step_error;
3178 if ((
zend_ulong)end_long - start_long < unsigned_step) {
3179 goto boundary_error;
3185 for (i = 0; i <
size; ++i) {
3208#undef RANGE_CHECK_DOUBLE_INIT_ARRAY
3209#undef RANGE_CHECK_LONG_INIT_ARRAY
3215 void *
state = engine.state;
3217 int64_t idx,
j, n_elems, rnd_idx, n_left;
3221 n_elems = zend_hash_num_elements(
Z_ARRVAL_P(array));
3235 for (; i > 0;
p++, i--) {
3237 zend_string_release(
p->key);
3246 if (
hash->nNumUsed !=
hash->nNumOfElements) {
3247 for (
j = 0, idx = 0; idx <
hash->nNumUsed; idx++) {
3248 zv =
hash->arPacked + idx;
3261 if (rnd_idx != n_left) {
3270 if (
hash->nNumUsed !=
hash->nNumOfElements) {
3271 for (
j = 0, idx = 0; idx <
hash->nNumUsed; idx++) {
3272 zv =
hash->arPacked + idx;
3276 if (idx == iter_pos) {
3277 zend_hash_iterators_update(
hash, idx,
j);
3289 if (rnd_idx != n_left) {
3293 zend_hash_iterators_update(
hash, (uint32_t)rnd_idx, n_left);
3297 hash->nNumUsed = n_elems;
3298 hash->nInternalPointer = 0;
3299 hash->nNextFreeElement = n_elems;
3330 num_in = zend_hash_num_elements(in_hash);
3341 length = num_in -
offset + length;
3342 }
else if (((
unsigned)
offset + (
unsigned)length) > (
unsigned)num_in) {
3343 length = num_in -
offset;
3356 if (idx == iter_pos) {
3358 zend_hash_iterators_update(in_hash, idx,
pos);
3366 if (removed !=
NULL) {
3374 if (idx == iter_pos) {
3375 zend_hash_iterators_update(in_hash, idx,
offset + length);
3382 for ( ; pos2 -
offset < length && idx < in_hash->
nNumUsed; idx++, entry++) {
3387 if (idx == iter_pos) {
3388 zend_hash_iterators_update(in_hash, idx,
offset + length);
3405 for ( ; idx < in_hash->
nNumUsed ; idx++, entry++) {
3408 if (idx == iter_pos) {
3410 zend_hash_iterators_update(in_hash, idx,
pos);
3425 if (
p->key ==
NULL) {
3430 if (idx == iter_pos) {
3432 zend_hash_iterators_update(in_hash, idx,
pos);
3440 if (removed !=
NULL) {
3446 if (
p->key ==
NULL) {
3456 for ( ; pos2 -
offset < length && idx < in_hash->
nNumUsed; idx++,
p++) {
3474 for ( ; idx < in_hash->
nNumUsed ; idx++,
p++) {
3477 if (
p->key ==
NULL) {
3482 if (idx == iter_pos) {
3484 zend_hash_iterators_update(in_hash, idx,
pos);
3507 zend_hash_internal_pointer_reset(in_hash);
3526 for (uint32_t i = 0; i < argc; i++) {
3531 zend_throw_error(
NULL,
"Cannot add element to the array as the next element is already occupied");
3552 if (zend_hash_num_elements(
Z_ARRVAL_P(stack)) == 0) {
3572 if (idx == (
Z_ARRVAL_P(stack)->nNextFreeElement - 1)) {
3604 zend_hash_internal_pointer_reset(
Z_ARRVAL_P(stack));
3623 if (zend_hash_num_elements(
Z_ARRVAL_P(stack)) == 0) {
3650 for (idx = 0; idx <
Z_ARRVAL_P(stack)->nNumUsed; idx++) {
3663 for (idx = 0; idx <
Z_ARRVAL_P(stack)->nNumUsed; idx++) {
3670 if (idx == iter_pos) {
3671 zend_hash_iterators_update(
Z_ARRVAL_P(stack), idx, k);
3682 int should_rehash = 0;
3704 for (idx = 0; idx <
Z_ARRVAL_P(stack)->nNumUsed; idx++) {
3707 if (
p->key ==
NULL) {
3717 if (should_rehash) {
3722 zend_hash_internal_pointer_reset(
Z_ARRVAL_P(stack));
3746 for (uint32_t i = 0; i < argc; i++) {
3778 zend_hash_internal_pointer_reset(
Z_ARRVAL_P(stack));
3793 bool length_is_null = 1;
3804 num_in = zend_hash_num_elements(
Z_ARRVAL_P(array));
3806 if (length_is_null) {
3870 return ht->arData +
ht->nNumUsed;
3897 return ht->arPacked +
ht->nNumUsed;
3908 bool length_is_null = 1;
3909 bool preserve_keys = 0;
3923 num_in = zend_hash_num_elements(
Z_ARRVAL_P(input));
3926 if (length_is_null) {
3939 length = num_in -
offset + length;
3941 length = num_in -
offset;
3965 if (__fill_idx >= length) {
3984 for (;
zv !=
end;
zv++, idx++) {
4001 for (;
p !=
end;
p++) {
4011 string_key =
p->key;
4016 if (preserve_keys) {
4031 zval *src_entry, *dest_entry;
4037 zval *src_zval = src_entry;
4038 zval *dest_zval = dest_entry;
4052 dest_zval = dest_entry;
4112 zend_hash_extend(dest, zend_hash_num_elements(dest) + zend_hash_num_elements(src), 1);
4143 zval *src_entry, *dest_entry, *src_zval, *dest_zval;
4149 src_zval = src_entry;
4173 dest_zval = dest_entry;
4184 dest_zval = dest_entry;
4223 for (i = 0; i < argc; i++) {
4234 bool in_place = zend_may_modify_arg_in_place(
arg);
4244 for (i = 1; i < argc; i++) {
4249 for (i = 1; i < argc; i++) {
4278 for (i = 0; i < argc; i++) {
4293 }
else if (zend_hash_num_elements(
Z_ARRVAL(
args[1])) == 0) {
4323 bool in_place =
false;
4359 _zend_hash_append(dest, string_key, src_entry);
4366 for (i = 1; i < argc; i++) {
4371 for (i = 1; i < argc; i++) {
4415 *search_value =
NULL,
4431 elem_count = zend_hash_num_elements(arrval);
4439 if (search_value !=
NULL) {
4445 if (fast_is_identical_function(search_value, entry)) {
4456 if (fast_equal_check_function(search_value, entry)) {
4474 for (; lval < elem_count; ++lval) {
4539 arrlen = zend_hash_num_elements(arrval);
4603 if (name_str ==
NULL) {
4606 tmp_str = zend_string_copy(name_str);
4621 zend_string_release(tmp_str);
4624 if (name_str !=
NULL) {
4647 bool column_is_null = 0;
4650 bool index_is_null = 1;
4664 if (index_is_null) {
4669 if (column_is_null) {
4672 }
else if ((colval = array_column_fetch_prop(
data, column_str, column_long, cache_slot_column, &
rv)) ==
NULL) {
4682 if (column_is_null) {
4685 }
else if ((colval = array_column_fetch_prop(
data, column_str, column_long, cache_slot_column, &
rv)) ==
NULL) {
4690 zval *keyval = array_column_fetch_prop(
data, index_str, index_long, cache_slot_index, &
rv);
4710 bool preserve_keys = 0;
4737 if (preserve_keys) {
4768 if (pad_size <
Z_L(-HT_MAX_SIZE) || pad_size >
Z_L(HT_MAX_SIZE)) {
4774 input_size = zend_hash_num_elements(
Z_ARRVAL_P(input));
4777 if (input_size >= pad_size_abs) {
4783 num_pads = pad_size_abs - input_size;
4794 for (i = 0; i < num_pads; i++) {
4809 for (i = 0; i < num_pads; i++) {
4816 for (i = 0; i < num_pads; i++) {
4831 for (i = 0; i < num_pads; i++) {
4878 zval *array, *entry;
4896 if (change_to_upper) {
4897 new_key = zend_string_toupper(string_key);
4899 new_key = zend_string_tolower(string_key);
4915static void array_bucketindex_swap(
void *
p,
void *q)
4941 if (
Z_ARRVAL_P(array)->nNumOfElements <= 1) {
4963 zend_tmp_string_release(tmp_str_val);
4985 cmp = php_get_data_compare_func_unstable(sort_type, 0);
4987 bool in_place = zend_may_modify_arg_in_place(array);
4998 for (
i = 0, idx = 0; idx <
Z_ARRVAL_P(array)->nNumUsed; idx++,
zv++) {
5008 for (
i = 0, idx = 0; idx <
Z_ARRVAL_P(array)->nNumUsed; idx++,
p++) {
5021 if (cmp(&lastkept->
b, &cmpdata->
b)) {
5024 if (lastkept->
i > cmpdata->
i) {
5030 if (
p->key ==
NULL) {
5045static int zval_compare(
zval *first,
zval *second)
5051static int zval_user_compare(
zval *
a,
zval *
b)
5059 BG(user_compare_fci).param_count = 2;
5060 BG(user_compare_fci).params =
args;
5061 BG(user_compare_fci).retval = &
retval;
5077 int (*intersect_data_compare_func)(
zval *,
zval *) =
NULL;
5089 intersect_data_compare_func = zval_user_compare;
5096 intersect_data_compare_func = zval_compare;
5104 for (
i = 0;
i < argc;
i++) {
5120 for (
i = 1;
i < argc;
i++) {
5122 (intersect_data_compare_func &&
5123 intersect_data_compare_func(
val,
data) != 0)
5135 for (
i = 1;
i < argc;
i++) {
5137 (intersect_data_compare_func &&
5138 intersect_data_compare_func(
val,
data) != 0)
5157 uint32_t arr_argc,
i;
5160 Bucket **lists, *list, **ptrs, *
p;
5167 bool in_place =
false;
5173 intersect_key_compare_func = php_array_key_compare_string;
5178 intersect_data_compare_func = php_array_data_compare_string_unstable;
5182 intersect_data_compare_func = php_array_user_compare_unstable;
5192 fci_data_cache = &fci1_cache;
5201 intersect_key_compare_func = php_array_key_compare_string_unstable;
5202 intersect_data_compare_func = php_array_data_compare_string_unstable;
5206 intersect_key_compare_func = php_array_key_compare_string_unstable;
5207 intersect_data_compare_func = php_array_user_compare_unstable;
5209 fci_data_cache = &fci1_cache;
5213 intersect_key_compare_func = php_array_user_key_compare_unstable;
5214 intersect_data_compare_func = php_array_data_compare_string_unstable;
5216 fci_key_cache = &fci1_cache;
5220 intersect_key_compare_func = php_array_user_key_compare_unstable;
5221 intersect_data_compare_func = php_array_user_compare_unstable;
5223 fci_data_cache = &fci1_cache;
5225 fci_key_cache = &fci2_cache;
5227 ZEND_ASSERT(0 &&
"Invalid data_compare_type / key_compare_type");
5247 BG(user_compare_fci) = *fci_data;
5248 BG(user_compare_fci_cache) = *fci_data_cache;
5250 BG(user_compare_fci) = *fci_key;
5251 BG(user_compare_fci_cache) = *fci_key_cache;
5254 for (
i = 0;
i < arr_argc;
i++) {
5266 for (idx = 0; idx <
hash->nNumUsed; idx++,
zv++) {
5275 for (idx = 0; idx <
hash->nNumUsed; idx++,
p++) {
5281 if (
hash->nNumOfElements > 1) {
5295 in_place = zend_may_modify_arg_in_place(&
args[0]);
5306 BG(user_compare_fci) = *fci_key;
5307 BG(user_compare_fci_cache) = *fci_key_cache;
5310 for (
i = 1;
i < arr_argc;
i++) {
5312 while (
Z_TYPE(ptrs[
i]->
val) !=
IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[
i])))) {
5316 while (
Z_TYPE(ptrs[
i]->
val) !=
IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[
i])))) {
5325 BG(user_compare_fci) = *fci_data;
5326 BG(user_compare_fci_cache) = *fci_data_cache;
5328 if (intersect_data_compare_func(ptrs[0], ptrs[
i]) != 0) {
5331 BG(user_compare_fci) = *fci_key;
5332 BG(user_compare_fci_cache) = *fci_key_cache;
5350 if (
p->key ==
NULL) {
5366 if (
p->key ==
NULL) {
5375 if (0 <= intersect_data_compare_func(ptrs[0], ptrs[
i])) {
5391 if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0])) {
5402 for (
i = 0;
i < arr_argc;
i++) {
5490 diff_data_compare_func = zval_user_compare;
5496 diff_data_compare_func = zval_compare;
5500 for (
i = 0;
i < argc;
i++) {
5516 for (
i = 1;
i < argc;
i++) {
5518 (!diff_data_compare_func ||
5519 diff_data_compare_func(
val,
data) == 0)
5531 for (
i = 1;
i < argc;
i++) {
5533 (!diff_data_compare_func ||
5534 diff_data_compare_func(
val,
data) == 0)
5553 uint32_t arr_argc,
i;
5556 Bucket **lists, *list, **ptrs, *
p;
5568 diff_key_compare_func = php_array_key_compare_string_unstable;
5573 diff_data_compare_func = php_array_data_compare_string_unstable;
5577 diff_data_compare_func = php_array_user_compare_unstable;
5587 fci_data_cache = &fci1_cache;
5596 diff_key_compare_func = php_array_key_compare_string_unstable;
5597 diff_data_compare_func = php_array_data_compare_string_unstable;
5601 diff_key_compare_func = php_array_key_compare_string_unstable;
5602 diff_data_compare_func = php_array_user_compare_unstable;
5604 fci_data_cache = &fci1_cache;
5608 diff_key_compare_func = php_array_user_key_compare_unstable;
5609 diff_data_compare_func = php_array_data_compare_string_unstable;
5611 fci_key_cache = &fci1_cache;
5615 diff_key_compare_func = php_array_user_key_compare_unstable;
5616 diff_data_compare_func = php_array_user_compare_unstable;
5618 fci_data_cache = &fci1_cache;
5620 fci_key_cache = &fci2_cache;
5622 ZEND_ASSERT(0 &&
"Invalid data_compare_type / key_compare_type");
5642 BG(user_compare_fci) = *fci_data;
5643 BG(user_compare_fci_cache) = *fci_data_cache;
5645 BG(user_compare_fci) = *fci_key;
5646 BG(user_compare_fci_cache) = *fci_key_cache;
5649 for (
i = 0;
i < arr_argc;
i++) {
5661 for (idx = 0; idx <
hash->nNumUsed; idx++,
zv++) {
5670 for (idx = 0; idx <
hash->nNumUsed; idx++,
p++) {
5676 if (
hash->nNumOfElements > 1) {
5698 BG(user_compare_fci) = *fci_key;
5699 BG(user_compare_fci_cache) = *fci_key_cache;
5702 for (
i = 1;
i < arr_argc;
i++) {
5705 while (
Z_TYPE(ptrs[
i]->
val) !=
IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[
i])))) {
5724 BG(user_compare_fci) = *fci_data;
5725 BG(user_compare_fci_cache) = *fci_data_cache;
5727 if (diff_data_compare_func(ptrs[0],
ptr) != 0) {
5731 BG(user_compare_fci) = *fci_key;
5732 BG(user_compare_fci_cache) = *fci_key_cache;
5754 if (
p->key ==
NULL) {
5763 if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) {
5779 if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) {
5790 for (
i = 0;
i < arr_argc;
i++) {
5839 for (
i = 1;
i < argc;
i++) {
5846 }
else if (num == 1) {
5856 for (
i = 1;
i < argc;
i++) {
5865 search_str = zval_get_tmp_string(
value, &tmp_search_str);
5867 for (
i = 1;
i < argc;
i++) {
5874 str = zval_get_tmp_string(
value, &tmp_str);
5875 if (zend_string_equals(search_str, str)) {
5876 zend_tmp_string_release(tmp_str);
5880 zend_tmp_string_release(tmp_str);
5885 zend_tmp_string_release(tmp_search_str);
5897 for (
i = 1;
i < argc;
i++) {
5913 for (
i = 1;
i < argc;
i++) {
5915 str = zval_get_tmp_string(
value, &tmp_str);
5917 zend_tmp_string_release(tmp_str);
5924 str = zval_get_tmp_string(
value, &tmp_str);
5925 if (!zend_hash_exists(&exclude, str)) {
5933 zend_tmp_string_release(tmp_str);
5975#define MULTISORT_ORDER 0
5976#define MULTISORT_TYPE 1
5977#define MULTISORT_LAST 2
5990 return result > 0 ? 1 : -1;
5995 return stable_sort_fallback(&ab[r], &bb[r]);
5999#define MULTISORT_ABORT \
6004static void array_bucket_p_sawp(
void *
p,
void *q) {
6024 uint32_t array_size;
6025 uint32_t num_arrays = 0;
6048 for (
i = 0;
i < argc;
i++) {
6061 arrays[num_arrays++] =
arg;
6113 array_size = zend_hash_num_elements(
Z_ARRVAL_P(arrays[0]));
6114 for (
i = 1;
i < num_arrays;
i++) {
6115 if (zend_hash_num_elements(
Z_ARRVAL_P(arrays[
i])) != array_size) {
6122 if (array_size < 1) {
6135 for (
i = 0;
i < array_size;
i++) {
6136 indirect[
i] = indirects + (
i * (num_arrays + 1));
6138 for (
i = 0;
i < num_arrays;
i++) {
6142 for (idx = 0; idx <
Z_ARRVAL_P(arrays[
i])->nNumUsed; idx++,
zv++) {
6145 indirect[k][
i].
h = idx;
6151 for (idx = 0; idx <
Z_ARRVAL_P(arrays[
i])->nNumUsed; idx++,
p++) {
6153 indirect[k][
i] = *
p;
6158 for (k = 0; k < array_size; k++) {
6170 for (
i = 0;
i < num_arrays;
i++) {
6172 hash->nNumUsed = array_size;
6173 hash->nNextFreeElement = array_size;
6174 hash->nInternalPointer = 0;
6176 for (k = 0; k < array_size; k++) {
6182 for (
n = 0, k = 0; k < array_size; k++) {
6183 hash->arData[k] = indirect[k][
i];
6185 hash->arData[k].h =
n++;
6211 void *
state = engine.state;
6214 uint32_t num_avail = zend_hash_num_elements(
ht);
6221 int negative_bitset = 0;
6222 uint32_t bitset_len;
6225 if (num_avail == 0) {
6233 if (num_avail < ht->nNumUsed - (
ht->nNumUsed >> 1)) {
6237 randval = algo->
range(
state, 0, num_avail - 1);
6264 zv = &
ht->arPacked[randval];
6276 b = &
ht->arData[randval];
6289 if (num_req <= 0 || num_req > num_avail) {
6298 if (num_req > (num_avail >> 1)) {
6299 negative_bitset = 1;
6300 num_req = num_avail - num_req;
6303 bitset_len = zend_bitset_len(num_avail);
6305 zend_bitset_clear(bitset, bitset_len);
6310 randval = algo->
range(
state, 0, num_avail - 1);
6314 if (zend_bitset_in(bitset, randval)) {
6323 zend_bitset_incl(bitset, randval);
6334 if (zend_bitset_in(bitset,
i) ^ negative_bitset) {
6370 php_random_default_engine(),
6391 if (zend_hash_num_elements(input) == 0) {
6479 if (zend_hash_num_elements(htbl) == 0) {
6515 bool have_callback = 0;
6529 if (zend_hash_num_elements(
Z_ARRVAL_P(array)) == 0) {
6548 if (have_callback) {
6604 if (result_value !=
NULL) {
6608 if (result_key !=
NULL) {
6612 if (zend_hash_num_elements(array) == 0) {
6641 retval_true ^= negate_condition;
6644 if (result_value !=
NULL) {
6648 if (result_key !=
NULL) {
6779 if (n_arrays == 1) {
6807 i_zval_ptr_dtor(&
arg);
6821 for (
i = 0;
i < n_arrays;
i++) {
6838 for (k = 0; k <
maxlen; k++) {
6844 for (
i = 0;
i < n_arrays;
i++) {
6847 uint32_t
pos = array_pos[
i];
6855 array_pos[
i] =
pos + 1;
6867 array_pos[
i] =
pos + 1;
6882 for (k = 0; k <
maxlen; k++) {
6883 for (
i = 0;
i < n_arrays;
i++) {
6886 uint32_t
pos = array_pos[
i];
6894 array_pos[
i] =
pos + 1;
6906 array_pos[
i] =
pos + 1;
6921 for (
i = 0;
i < n_arrays;
i++) {
6927 for (
i = 0;
i < n_arrays;
i++) {
6990 bool preserve_keys = 0;
7008 num_in = zend_hash_num_elements(
Z_ARRVAL_P(input));
7010 if (
size > num_in) {
7029 if (preserve_keys) {
7059 uint32_t pos_values = 0;
7060 zval *entry_keys, *entry_values;
7061 int num_keys, num_values;
7068 num_keys = zend_hash_num_elements(keys);
7069 num_values = zend_hash_num_elements(values);
7071 if (num_keys != num_values) {
7083 if (pos_values >= values->
nNumUsed) {
7090 Z_LVAL_P(entry_keys), entry_values);
7096 zend_tmp_string_release(tmp_key);
array_slice(array $array, int $offset, ?int $length=null, bool $preserve_keys=false)
array_find_key(array $array, callable $callback)
array_intersect_key(array $array, array ... $arrays)
array_fill(int $start_index, int $count, mixed $value)
array_chunk(array $array, int $length, bool $preserve_keys=false)
array_key_exists($key, array $array)
array_intersect_uassoc(array $array,... $rest)
array_key_first(array $array)
array_shift(array &$array)
array_reverse(array $array, bool $preserve_keys=false)
array_product(array $array)
array_rand(array $array, int $num=1)
krsort(array &$array, int $flags=SORT_REGULAR)
in_array(mixed $needle, array $haystack, bool $strict=false)
array_keys(array $array, mixed $filter_value=UNKNOWN, bool $strict=false)
array_values(array $array)
array_udiff(array $array,... $rest)
array_merge(array ... $arrays)
array_replace(array $array, array ... $replacements)
array_diff_key(array $array, array ... $arrays)
array_intersect(array $array, array ... $arrays)
array_unique(array $array, int $flags=SORT_STRING)
array_diff_uassoc(array $array,... $rest)
array_find(array $array, callable $callback)
prev(array|object &$array)
strcoll(string $string1, string $string2)
array_intersect_assoc(array $array, array ... $arrays)
copy(string $from, string $to, $context=null)
array_uintersect(array $array,... $rest)
array_count_values(array $array)
array_filter(array $array, ?callable $callback=null, int $mode=0)
array_reduce(array $array, callable $callback, mixed $initial=null)
array_all(array $array, callable $callback)
array_map(?callable $callback, array $array, array ... $arrays)
array_diff_assoc(array $array, array ... $arrays)
array_uintersect_assoc(array $array,... $rest)
usort(array &$array, callable $callback)
rsort(array &$array, int $flags=SORT_REGULAR)
array_fill_keys(array $keys, mixed $value)
array_replace_recursive(array $array, array ... $replacements)
array_search(mixed $needle, array $haystack, bool $strict=false)
reset(array|object &$array)
count(Countable|array $value, int $mode=COUNT_NORMAL)
array_key_last(array $array)
natcasesort(array &$array)
array_diff_ukey(array $array,... $rest)
array_pad(array $array, int $length, mixed $value)
arsort(array &$array, int $flags=SORT_REGULAR)
array_splice(array &$array, int $offset, ?int $length=null, mixed $replacement=[])
array_udiff_uassoc(array $array,... $rest)
compact($var_name,... $var_names)
array_any(array $array, callable $callback)
array_merge_recursive(array ... $arrays)
ksort(array &$array, int $flags=SORT_REGULAR)
array_walk(array|object &$array, callable $callback, mixed $arg=UNKNOWN)
uasort(array &$array, callable $callback)
array_diff(array $array, array ... $arrays)
asort(array &$array, int $flags=SORT_REGULAR)
array_multisort(&$array, &... $rest)
extract(array &$array, int $flags=EXTR_OVERWRITE, string $prefix="")
uksort(array &$array, callable $callback)
array_intersect_ukey(array $array,... $rest)
array_walk_recursive(array|object &$array, callable $callback, mixed $arg=UNKNOWN)
array_push(array &$array, mixed ... $values)
array_udiff_assoc(array $array,... $rest)
array_column(array $array, int|string|null $column_key, int|string|null $index_key=null)
array_change_key_case(array $array, int $case=CASE_LOWER)
array_unshift(array &$array, mixed ... $values)
array_uintersect_uassoc(array $array,... $rest)
array_combine(array $keys, array $values)
memset(ptr, 0, type->size)
hash(string $algo, string $data, bool $binary=false, array $options=[])
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""
enum entity_charset charset
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
PHPAPI ZEND_COLD void php_error_docref_unchecked(const char *docref, int type, const char *format,...)
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_EXTR_OVERWRITE
#define ARRAY_FILTER_USE_BOTH
#define ARRAY_FILTER_USE_KEY
#define PHP_EXTR_PREFIX_INVALID
#define PHP_SORT_FLAG_CASE
bucket_compare_func_t * multisort_func
#define PHP_EXTR_PREFIX_SAME
#define PHP_EXTR_PREFIX_IF_EXISTS
#define PHP_EXTR_IF_EXISTS
#define PHP_COUNT_RECURSIVE
bool compare_deprecation_thrown
#define PHP_SORT_LOCALE_STRING
#define PHP_EXTR_PREFIX_ALL
unsigned const char * end
unsigned const char * pos
collator_compare_func_t compare_func
struct _php_random_algo_with_state php_random_algo_with_state
struct _php_random_algo php_random_algo
#define PHP_RANDOM_RANGE_ATTEMPTS
PHPAPI zend_class_entry * random_ce_Random_BrokenRandomEngineError
unsigned char key[REFLECTION_KEY_LEN]
PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len, bool is_case_insensitive)
#define DEFINE_SORT_VARIANTS(name)
#define PHP_ARRAY_CMP_FUNC_VARS
#define INTERSECT_COMP_KEY_INTERNAL
#define INTERSECT_COMP_KEY_USER
#define DIFF_COMP_KEY_INTERNAL
#define INTERSECT_COMP_DATA_NONE
PHPAPI int php_prefix_varname(zval *result, zend_string *prefix, const char *var_name, size_t var_name_len, bool add_underscore)
#define RANGE_CHECK_LONG_INIT_ARRAY(start, end, _step)
#define INTERSECT_COMP_DATA_USER
PHPAPI int php_multisort_compare(const void *a, const void *b)
#define INTERSECT_COMP_DATA_INTERNAL
#define PHP_ARRAY_CMP_FUNC_BACKUP()
#define DIFF_COMP_DATA_NONE
#define DIFF_COMP_KEY_USER
#define DIFF_COMP_DATA_INTERNAL
PHPAPI zend_long php_count_recursive(HashTable *ht)
#define PHP_ARRAY_CMP_FUNC_RESTORE()
PHPAPI bool php_array_data_shuffle(php_random_algo_with_state engine, zval *array)
PHPAPI int php_array_merge(HashTable *dest, HashTable *src)
PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src)
#define DIFF_COMP_DATA_USER
#define RANGE_CHECK_DOUBLE_INIT_ARRAY(start, end, _step)
PHPAPI bool php_array_pick_keys(php_random_algo_with_state engine, zval *input, zend_long num_req, zval *retval, bool silent)
PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src)
#define RETURN_STABLE_SORT(a, b, result)
zend_long(* range)(void *state, zend_long min, zend_long max)
zend_long nNextFreeElement
zend_fcall_info_cache fci_cache
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API ZEND_COLD void zend_type_error(const char *format,...)
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
#define INTERNAL_FUNCTION_PARAMETERS
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
ZEND_API zend_result add_next_index_null(zval *arg)
ZEND_API zend_result array_set_zval_key(HashTable *ht, zval *key, zval *value)
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API const char * zend_zval_type_name(const zval *arg)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num)
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
#define Z_PARAM_FUNC(dest_fci, dest_fcc)
#define Z_PARAM_NUMBER(dest)
ZEND_API const zend_fcall_info empty_fcall_info
#define RETURN_COPY_DEREF(zv)
ZEND_API const zend_fcall_info_cache empty_fcall_info_cache
struct _zend_fcall_info_cache zend_fcall_info_cache
#define Z_PARAM_ARRAY_EX2(dest, check_null, deref, separate)
#define ZEND_PARSE_PARAMETERS_END()
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor)
#define ZEND_DECLARE_MODULE_GLOBALS(module_name)
#define ZEND_TRY_ASSIGN_COPY_EX(zv, other_zv, strict)
#define array_init_size(arg, size)
#define Z_PARAM_ARRAY_OR_OBJECT_EX(dest, check_null, separate)
#define ZEND_FCI_INITIALIZED(fci)
#define ZEND_PARSE_PARAMETERS_END_EX(failure)
#define Z_PARAM_STR(dest)
#define Z_PARAM_STR_OR_LONG_OR_NULL(dest_str, dest_long, is_null)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define Z_PARAM_NUMBER_OR_STR(dest)
#define Z_PARAM_LONG(dest)
#define Z_PARAM_VARIADIC(spec, dest, dest_num)
#define RETVAL_EMPTY_ARRAY()
struct _zend_fcall_info zend_fcall_info
#define Z_PARAM_ARRAY_HT(dest)
#define Z_PARAM_LONG_OR_NULL(dest, is_null)
#define RETURN_COPY_VALUE(zv)
#define Z_PARAM_ARRAY_EX(dest, check_null, separate)
#define Z_PARAM_BOOL(dest)
#define RETURN_EMPTY_ARRAY()
#define Z_PARAM_ARRAY(dest)
ZEND_API zend_array * zend_rebuild_symbol_table(void)
#define Z_PARAM_ZVAL(dest)
#define Z_PARAM_FUNC_OR_NULL(dest_fci, dest_fcc)
ZEND_API zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache)
#define Z_PARAM_ARRAY_OR_OBJECT(dest)
#define RETVAL_COPY_VALUE(zv)
#define RETURN_STR_COPY(s)
#define ecalloc(nmemb, size)
#define pefree(ptr, persistent)
#define pemalloc(size, persistent)
#define safe_emalloc(nmemb, size, offset)
#define ZEND_BITSET_ALLOCA(n, use_heap)
zend_string_release_ex(func->internal_function.function_name, 0)
zend_result(ZEND_FASTCALL * binary_op_type)(zval *, zval *, zval *)
struct _zend_property_info zend_property_info
ZEND_API void zend_clear_exception(void)
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_use_resource_as_offset(const zval *dim)
ZEND_API zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_cannot_add_element(void)
ZEND_API const char * get_active_function_name(void)
ZEND_API zend_object * zend_get_this_object(zend_execute_data *ex)
ZEND_API const char * get_active_function_arg_name(uint32_t arg_num)
#define ZEND_REF_ADD_TYPE_SOURCE(ref, source)
#define Z_FLF_PARAM_ARRAY(arg_num, dest)
union _zend_function zend_function
#define Z_FLF_PARAM_ZVAL(arg_num, dest)
#define Z_FLF_PARAM_BOOL(arg_num, dest)
#define ZEND_FRAMELESS_FUNCTION(name, arity)
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos)
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q)
ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht)
ZEND_API HashTable * zend_array_to_list(HashTable *source)
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos)
ZEND_API void ZEND_FASTCALL zend_hash_rehash(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t flag)
ZEND_API zval *ZEND_FASTCALL zend_hash_next_index_insert_new(HashTable *ht, zval *pData)
ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos)
ZEND_API zval *ZEND_FASTCALL zend_hash_next_index_insert(HashTable *ht, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos)
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed)
ZEND_API void ZEND_FASTCALL zend_hash_iterators_advance(HashTable *ht, HashPosition step)
ZEND_API zval *ZEND_FASTCALL zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_packed_del_val(HashTable *ht, zval *zv)
ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite)
ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p)
ZEND_API zval *ZEND_FASTCALL zend_hash_add_new(HashTable *ht, zend_string *key, zval *pData)
ZEND_API zend_result ZEND_FASTCALL zend_hash_index_del(HashTable *ht, zend_ulong h)
ZEND_API zval *ZEND_FASTCALL zend_hash_find_known_hash(const HashTable *ht, const zend_string *key)
ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, const HashPosition *pos)
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht)
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed)
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array)
ZEND_API HashTable *ZEND_FASTCALL zend_array_dup(HashTable *source)
ZEND_API zval *ZEND_FASTCALL zend_hash_update(HashTable *ht, zend_string *key, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_add_empty_element(HashTable *ht, zend_string *key)
ZEND_API zend_result ZEND_FASTCALL zend_hash_del(HashTable *ht, zend_string *key)
ZEND_API zval *ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key)
ZEND_API zval *ZEND_FASTCALL zend_hash_add(HashTable *ht, zend_string *key, zval *pData)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterators_lower_pos(HashTable *ht, HashPosition start)
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx)
#define ZEND_HASH_FILL_ADD(_val)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define ZEND_HASH_ELEMENT(__ht, _idx)
#define ZEND_HASH_MAP_FOREACH_BUCKET(ht, _bucket)
#define ZEND_HASH_FILL_SET_DOUBLE(_val)
#define HT_IS_WITHOUT_HOLES(ht)
#define ZEND_HASH_FILL_PACKED(ht)
int(* bucket_compare_func_t)(Bucket *a, Bucket *b)
#define ZEND_HASH_PACKED_REVERSE_FOREACH_VAL(ht, _val)
#define ZEND_HASH_REVERSE_FOREACH_KEY_VAL(ht, _h, _key, _val)
#define ZEND_HASH_FILL_END()
#define ZEND_HASH_FOREACH_KEY(ht, _h, _key)
#define HT_HAS_STATIC_KEYS_ONLY(ht)
#define HT_ITERATORS_COUNT(ht)
#define HT_SET_ITERATORS_COUNT(ht, iters)
#define HT_HAS_ITERATORS(ht)
#define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val)
#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val)
#define ZEND_HASH_FILL_SET_LONG(_val)
#define ZEND_HASH_FILL_SET_INTERNED_STR(_val)
#define ZEND_HASH_PACKED_FOREACH_VAL(ht, _val)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_FILL_NEXT()
#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(ht, _key, _val)
#define ZEND_HASH_FOREACH_STR_KEY(ht, _key)
#define ZEND_HASH_FOREACH_VAL(ht, _val)
#define ZEND_HASH_FILL_SET_STR_COPY(_val)
ZEND_API zend_class_entry * zend_ce_countable
#define MAX_LENGTH_OF_LONG
struct _zend_string zend_string
#define ZEND_PROPERTY_ISSET
#define ZEND_PROPERTY_EXISTS
ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2)
ZEND_API zend_string *ZEND_FASTCALL zend_long_to_str(zend_long num)
ZEND_API int ZEND_FASTCALL zend_binary_strcmp(const char *s1, size_t len1, const char *s2, size_t len2)
ZEND_API zend_result ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2)
ZEND_API void ZEND_FASTCALL convert_to_array(zval *op)
ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(zend_string *s1, zend_string *s2)
ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op)
ZEND_API uint8_t ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval)
ZEND_API zend_result ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp_l(const char *s1, size_t len1, const char *s2, size_t len2)
#define ZEND_UNCOMPARABLE
#define ALLOCA_FLAG(name)
#define ZEND_NORMALIZE_BOOL(n)
#define zend_never_inline
#define EXPECTED(condition)
#define ZEND_THREEWAY_COMPARE(a, b)
#define zend_always_inline
#define ZEND_BIT_TEST(bits, bit)
#define free_alloca(p, use_heap)
#define EMPTY_SWITCH_DEFAULT_CASE()
#define UNEXPECTED(condition)
struct _zend_array zend_array
struct _zend_object zend_object
ZEND_API void zend_sort(void *base, size_t nmemb, size_t siz, compare_func_t cmp, swap_func_t swp)
#define zend_string_equals_literal(str, literal)
#define ZSTR_EMPTY_ALLOC()
ZEND_API double zend_strtod(const char *s00, const char **se)
#define Z_OBJ_HANDLER_P(zv_p, hf)
int(* compare_func_t)(const void *, const void *)
#define GC_PROTECT_RECURSION(p)
#define Z_ISREF_P(zval_p)
#define Z_TRY_ADDREF_P(pz)
#define Z_REFVAL_P(zval_p)
#define Z_STRVAL_P(zval_p)
#define Z_ISUNDEF_P(zval_p)
#define Z_ARRVAL_P(zval_p)
#define Z_REFCOUNTED_P(zval_p)
#define ZVAL_STR_COPY(z, s)
struct _zend_array HashTable
#define Z_OBJ_HT_P(zval_p)
#define ZVAL_COPY_DEREF(z, v)
#define Z_COUNTED_P(zval_p)
#define ZVAL_NEW_REF(z, r)
#define Z_UNPROTECT_RECURSION_P(zv)
#define Z_STRLEN_P(zval_p)
#define GC_TRY_UNPROTECT_RECURSION(p)
#define GC_ADDREF_EX(p, rc)
#define Z_OBJCE_P(zval_p)
#define GC_TRY_PROTECT_RECURSION(p)
#define Z_RES_HANDLE_P(zval_p)
#define ZVAL_NEW_STR(z, s)
#define ZVAL_MAKE_REF(zv)
#define GC_UNPROTECT_RECURSION(p)
void(* swap_func_t)(void *, void *)
#define Z_INDIRECT_P(zval_p)
#define Z_OBJPROP_P(zval_p)
#define ZVAL_DOUBLE(z, d)
#define ZVAL_OBJ_COPY(z, o)
#define Z_PROTECT_RECURSION_P(zv)
#define ZVAL_MAKE_REF_EX(z, refcount)
ZEND_RESULT_CODE zend_result
#define IS_ARRAY_IMMUTABLE
#define IS_ARRAY_PERSISTENT
#define SEPARATE_ARRAY(zv)
#define GC_IS_RECURSIVE(p)
#define SEPARATE_ZVAL(zv)
#define ZVAL_COPY_VALUE(z, v)
#define Z_EXTRA_P(zval_p)
#define ZVAL_DEINDIRECT(z)
#define Z_IS_RECURSIVE_P(zv)
#define Z_TRY_DELREF_P(pz)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)
ZEND_API void zval_add_ref(zval *p)
zend_property_info * prop_info
zend_refcounted * garbage