Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90b7bde

Browse files
committed
Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys. - the elements of packed array are accessible throuf as ht->arPacked[i] instead of ht->arData[i] - in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes (ZEND_HASH_MAP_FOREACH_*) - introduced an additional family of macros to access elements of array (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX, ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT - zend_hash_minmax() prototype was changed to compare only values Because of smaller data set, this patch may show performance improvement on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser) TODO: - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET). - zend_hash_sort_ex() may require converting packed arrays to hash.
1 parent 0eb603e commit 90b7bde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3281
-1643
lines changed

Zend/Optimizer/sccp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ static inline zend_result ct_eval_in_array(zval *result, uint32_t extended_value
767767
zval key_tmp;
768768

769769
res = 0;
770-
ZEND_HASH_FOREACH_STR_KEY(ht, key) {
770+
ZEND_HASH_MAP_FOREACH_STR_KEY(ht, key) {
771771
ZVAL_STR(&key_tmp, key);
772772
if (zend_compare(op1, &key_tmp) == 0) {
773773
res = 1;

Zend/Optimizer/zend_optimizer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,15 +1360,15 @@ void zend_foreach_op_array(zend_script *script, zend_op_array_func_t func, void
13601360

13611361
zend_foreach_op_array_helper(&script->main_op_array, func, context);
13621362

1363-
ZEND_HASH_FOREACH_PTR(&script->function_table, op_array) {
1363+
ZEND_HASH_MAP_FOREACH_PTR(&script->function_table, op_array) {
13641364
zend_foreach_op_array_helper(op_array, func, context);
13651365
} ZEND_HASH_FOREACH_END();
13661366

1367-
ZEND_HASH_FOREACH_STR_KEY_PTR(&script->class_table, key, ce) {
1367+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&script->class_table, key, ce) {
13681368
if (ce->refcount > 1 && !zend_string_equals_ci(key, ce->name)) {
13691369
continue;
13701370
}
1371-
ZEND_HASH_FOREACH_PTR(&ce->function_table, op_array) {
1371+
ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, op_array) {
13721372
if (op_array->scope == ce
13731373
&& op_array->type == ZEND_USER_FUNCTION
13741374
&& !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)) {
@@ -1516,11 +1516,11 @@ ZEND_API void zend_optimize_script(zend_script *script, zend_long optimization_l
15161516
}
15171517
}
15181518

1519-
ZEND_HASH_FOREACH_STR_KEY_PTR(&script->class_table, key, ce) {
1519+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&script->class_table, key, ce) {
15201520
if (ce->refcount > 1 && !zend_string_equals_ci(key, ce->name)) {
15211521
continue;
15221522
}
1523-
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) {
1523+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) {
15241524
if (op_array->scope != ce && op_array->type == ZEND_USER_FUNCTION) {
15251525
zend_op_array *orig_op_array =
15261526
zend_hash_find_ptr(&op_array->scope->function_table, name);

Zend/zend_API.c

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,11 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
12841284
zend_string *key;
12851285
zval *value;
12861286

1287+
if (HT_IS_PACKED(properties)) {
1288+
return;
1289+
}
12871290
EG(fake_scope) = Z_OBJCE_P(obj);
1288-
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, value) {
1291+
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(properties, key, value) {
12891292
if (key) {
12901293
write_property(zobj, key, value, NULL);
12911294
}
@@ -1321,7 +1324,7 @@ ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_
13211324
zend_hash_init(constants_table, zend_hash_num_elements(&class_type->constants_table), NULL, NULL, 0);
13221325
zend_hash_extend(constants_table, zend_hash_num_elements(&class_type->constants_table), 0);
13231326

1324-
ZEND_HASH_FOREACH_STR_KEY_PTR(&class_type->constants_table, key, c) {
1327+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&class_type->constants_table, key, c) {
13251328
if (Z_TYPE(c->value) == IS_CONSTANT_AST) {
13261329
new_c = zend_arena_alloc(&CG(arena), sizeof(zend_class_constant));
13271330
memcpy(new_c, c, sizeof(zend_class_constant));
@@ -1409,7 +1412,7 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
14091412
} else {
14101413
constants_table = &class_type->constants_table;
14111414
}
1412-
ZEND_HASH_FOREACH_PTR(constants_table, c) {
1415+
ZEND_HASH_MAP_FOREACH_PTR(constants_table, c) {
14131416
if (Z_TYPE(c->value) == IS_CONSTANT_AST) {
14141417
val = &c->value;
14151418
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
@@ -1461,7 +1464,7 @@ ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type) /
14611464
}
14621465

14631466
if (class_type->default_static_members_count) {
1464-
ZEND_HASH_FOREACH_PTR(&class_type->properties_info, prop_info) {
1467+
ZEND_HASH_MAP_FOREACH_PTR(&class_type->properties_info, prop_info) {
14651468
if (prop_info->flags & ZEND_ACC_STATIC) {
14661469
val = static_members_table + prop_info->offset;
14671470
if (Z_TYPE_P(val) == IS_CONSTANT_AST
@@ -1526,7 +1529,7 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
15261529
zend_string *key;
15271530
zend_property_info *property_info;
15281531

1529-
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
1532+
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(properties, key, prop) {
15301533
property_info = zend_get_property_info(object->ce, key, 1);
15311534
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
15321535
property_info &&
@@ -2243,7 +2246,7 @@ ZEND_API void zend_collect_module_handlers(void) /* {{{ */
22432246
int class_count = 0;
22442247

22452248
/* Collect extensions with request startup/shutdown handlers */
2246-
ZEND_HASH_FOREACH_PTR(&module_registry, module) {
2249+
ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) {
22472250
if (module->request_startup_func) {
22482251
startup_count++;
22492252
}
@@ -2266,7 +2269,7 @@ ZEND_API void zend_collect_module_handlers(void) /* {{{ */
22662269
module_post_deactivate_handlers[post_deactivate_count] = NULL;
22672270
startup_count = 0;
22682271

2269-
ZEND_HASH_FOREACH_PTR(&module_registry, module) {
2272+
ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) {
22702273
if (module->request_startup_func) {
22712274
module_request_startup_handlers[startup_count++] = module;
22722275
}
@@ -2279,7 +2282,7 @@ ZEND_API void zend_collect_module_handlers(void) /* {{{ */
22792282
} ZEND_HASH_FOREACH_END();
22802283

22812284
/* Collect internal classes with static members */
2282-
ZEND_HASH_FOREACH_PTR(CG(class_table), ce) {
2285+
ZEND_HASH_MAP_FOREACH_PTR(CG(class_table), ce) {
22832286
if (ce->type == ZEND_INTERNAL_CLASS &&
22842287
ce->default_static_members_count > 0) {
22852288
class_count++;
@@ -2292,7 +2295,7 @@ ZEND_API void zend_collect_module_handlers(void) /* {{{ */
22922295
class_cleanup_handlers[class_count] = NULL;
22932296

22942297
if (class_count) {
2295-
ZEND_HASH_FOREACH_PTR(CG(class_table), ce) {
2298+
ZEND_HASH_MAP_FOREACH_PTR(CG(class_table), ce) {
22962299
if (ce->type == ZEND_INTERNAL_CLASS &&
22972300
ce->default_static_members_count > 0) {
22982301
class_cleanup_handlers[--class_count] = ce;
@@ -2981,7 +2984,7 @@ ZEND_API void zend_deactivate_modules(void) /* {{{ */
29812984
if (EG(full_tables_cleanup)) {
29822985
zend_module_entry *module;
29832986

2984-
ZEND_HASH_REVERSE_FOREACH_PTR(&module_registry, module) {
2987+
ZEND_HASH_MAP_REVERSE_FOREACH_PTR(&module_registry, module) {
29852988
if (module->request_shutdown_func) {
29862989
zend_try {
29872990
module->request_shutdown_func(module->type, module->module_number);
@@ -3009,20 +3012,20 @@ ZEND_API void zend_post_deactivate_modules(void) /* {{{ */
30093012
zval *zv;
30103013
zend_string *key;
30113014

3012-
ZEND_HASH_FOREACH_PTR(&module_registry, module) {
3015+
ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) {
30133016
if (module->post_deactivate_func) {
30143017
module->post_deactivate_func();
30153018
}
30163019
} ZEND_HASH_FOREACH_END();
3017-
ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL(&module_registry, key, zv) {
3020+
ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL(&module_registry, key, zv) {
30183021
module = Z_PTR_P(zv);
30193022
if (module->type != MODULE_TEMPORARY) {
30203023
break;
30213024
}
30223025
module_destructor(module);
30233026
free(module);
30243027
zend_string_release_ex(key, 0);
3025-
} ZEND_HASH_FOREACH_END_DEL();
3028+
} ZEND_HASH_MAP_FOREACH_END_DEL();
30263029
} else {
30273030
zend_module_entry **p = module_post_deactivate_handlers;
30283031

@@ -3267,14 +3270,14 @@ ZEND_API zend_result zend_disable_class(const char *class_name, size_t class_nam
32673270
INIT_CLASS_ENTRY_INIT_METHODS((*disabled_class), disabled_class_new);
32683271
disabled_class->create_object = display_disabled_class;
32693272

3270-
ZEND_HASH_FOREACH_PTR(&disabled_class->function_table, fn) {
3273+
ZEND_HASH_MAP_FOREACH_PTR(&disabled_class->function_table, fn) {
32713274
if ((fn->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
32723275
fn->common.scope == disabled_class) {
32733276
zend_free_internal_arg_info(&fn->internal_function);
32743277
}
32753278
} ZEND_HASH_FOREACH_END();
32763279
zend_hash_clean(&disabled_class->function_table);
3277-
ZEND_HASH_FOREACH_PTR(&disabled_class->properties_info, prop) {
3280+
ZEND_HASH_MAP_FOREACH_PTR(&disabled_class->properties_info, prop) {
32783281
if (prop->ce == disabled_class) {
32793282
zend_string_release(prop->name);
32803283
zend_type_release(prop->type, /* persistent */ 1);

Zend/zend_attributes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static zend_attribute *get_attribute(HashTable *attributes, zend_string *lcname,
7878
if (attributes) {
7979
zend_attribute *attr;
8080

81-
ZEND_HASH_FOREACH_PTR(attributes, attr) {
81+
ZEND_HASH_PACKED_FOREACH_PTR(attributes, attr) {
8282
if (attr->offset == offset && zend_string_equals(attr->lcname, lcname)) {
8383
return attr;
8484
}
@@ -93,7 +93,7 @@ static zend_attribute *get_attribute_str(HashTable *attributes, const char *str,
9393
if (attributes) {
9494
zend_attribute *attr;
9595

96-
ZEND_HASH_FOREACH_PTR(attributes, attr) {
96+
ZEND_HASH_PACKED_FOREACH_PTR(attributes, attr) {
9797
if (attr->offset == offset && ZSTR_LEN(attr->lcname) == len) {
9898
if (0 == memcmp(ZSTR_VAL(attr->lcname), str, len)) {
9999
return attr;
@@ -173,7 +173,7 @@ ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *
173173
{
174174
zend_attribute *other;
175175

176-
ZEND_HASH_FOREACH_PTR(attributes, other) {
176+
ZEND_HASH_PACKED_FOREACH_PTR(attributes, other) {
177177
if (other != attr && other->offset == attr->offset) {
178178
if (zend_string_equals(other->lcname, attr->lcname)) {
179179
return 1;

Zend/zend_builtin_functions.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ static void add_class_vars(zend_class_entry *scope, zend_class_entry *ce, bool s
669669
zend_string *key;
670670
zval *default_properties_table = CE_DEFAULT_PROPERTIES_TABLE(ce);
671671

672-
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) {
672+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&ce->properties_info, key, prop_info) {
673673
if (((prop_info->flags & ZEND_ACC_PROTECTED) &&
674674
!zend_check_protected(prop_info->ce, scope)) ||
675675
((prop_info->flags & ZEND_ACC_PRIVATE) &&
@@ -758,7 +758,7 @@ ZEND_FUNCTION(get_object_vars)
758758
} else {
759759
array_init_size(return_value, zend_hash_num_elements(properties));
760760

761-
ZEND_HASH_FOREACH_KEY_VAL(properties, num_key, key, value) {
761+
ZEND_HASH_MAP_FOREACH_KEY_VAL(properties, num_key, key, value) {
762762
bool is_dynamic = 1;
763763
if (Z_TYPE_P(value) == IS_INDIRECT) {
764764
value = Z_INDIRECT_P(value);
@@ -838,7 +838,7 @@ ZEND_FUNCTION(get_class_methods)
838838
array_init(return_value);
839839
scope = zend_get_executed_scope();
840840

841-
ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) {
841+
ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, mptr) {
842842
if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC)
843843
|| (scope &&
844844
(((mptr->common.fn_flags & ZEND_ACC_PROTECTED) &&
@@ -1094,7 +1094,7 @@ ZEND_FUNCTION(get_included_files)
10941094
ZEND_PARSE_PARAMETERS_NONE();
10951095

10961096
array_init(return_value);
1097-
ZEND_HASH_FOREACH_STR_KEY(&EG(included_files), entry) {
1097+
ZEND_HASH_MAP_FOREACH_STR_KEY(&EG(included_files), entry) {
10981098
if (entry) {
10991099
add_next_index_str(return_value, zend_string_copy(entry));
11001100
}
@@ -1248,7 +1248,7 @@ static inline void get_declared_class_impl(INTERNAL_FUNCTION_PARAMETERS, int fla
12481248
array_init(return_value);
12491249
zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
12501250
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
1251-
ZEND_HASH_FOREACH_STR_KEY_VAL(EG(class_table), key, zv) {
1251+
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(EG(class_table), key, zv) {
12521252
ce = Z_PTR_P(zv);
12531253
if ((ce->ce_flags & (ZEND_ACC_LINKED|ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT)) == flags
12541254
&& key
@@ -1309,7 +1309,7 @@ ZEND_FUNCTION(get_defined_functions)
13091309
array_init(&user);
13101310
array_init(return_value);
13111311

1312-
ZEND_HASH_FOREACH_STR_KEY_PTR(EG(function_table), key, func) {
1312+
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(function_table), key, func) {
13131313
if (key && ZSTR_VAL(key)[0] != 0) {
13141314
if (func->type == ZEND_INTERNAL_FUNCTION) {
13151315
add_next_index_str(&internal, zend_string_copy(key));
@@ -1455,7 +1455,7 @@ ZEND_FUNCTION(get_loaded_extensions)
14551455
} else {
14561456
zend_module_entry *module;
14571457

1458-
ZEND_HASH_FOREACH_PTR(&module_registry, module) {
1458+
ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) {
14591459
add_next_index_string(return_value, module->name);
14601460
} ZEND_HASH_FOREACH_END();
14611461
}
@@ -1485,13 +1485,13 @@ ZEND_FUNCTION(get_defined_constants)
14851485
module_names = emalloc((zend_hash_num_elements(&module_registry) + 2) * sizeof(char *));
14861486

14871487
module_names[0] = "internal";
1488-
ZEND_HASH_FOREACH_PTR(&module_registry, module) {
1488+
ZEND_HASH_MAP_FOREACH_PTR(&module_registry, module) {
14891489
module_names[module->module_number] = (char *)module->name;
14901490
i++;
14911491
} ZEND_HASH_FOREACH_END();
14921492
module_names[i] = "user";
14931493

1494-
ZEND_HASH_FOREACH_PTR(EG(zend_constants), val) {
1494+
ZEND_HASH_MAP_FOREACH_PTR(EG(zend_constants), val) {
14951495
if (!val->name) {
14961496
/* skip special constants */
14971497
continue;
@@ -1521,7 +1521,7 @@ ZEND_FUNCTION(get_defined_constants)
15211521
zend_constant *constant;
15221522
zval const_val;
15231523

1524-
ZEND_HASH_FOREACH_PTR(EG(zend_constants), constant) {
1524+
ZEND_HASH_MAP_FOREACH_PTR(EG(zend_constants), constant) {
15251525
if (!constant->name) {
15261526
/* skip special constants */
15271527
continue;
@@ -1606,7 +1606,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
16061606
zend_string *name;
16071607
zval *arg;
16081608
SEPARATE_ARRAY(arg_array);
1609-
ZEND_HASH_FOREACH_STR_KEY_VAL(call->extra_named_params, name, arg) {
1609+
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(call->extra_named_params, name, arg) {
16101610
ZVAL_DEREF(arg);
16111611
Z_TRY_ADDREF_P(arg);
16121612
zend_hash_add_new(Z_ARRVAL_P(arg_array), name, arg);
@@ -1902,7 +1902,7 @@ ZEND_FUNCTION(get_extension_funcs)
19021902
array = 0;
19031903
}
19041904

1905-
ZEND_HASH_FOREACH_PTR(CG(function_table), zif) {
1905+
ZEND_HASH_MAP_FOREACH_PTR(CG(function_table), zif) {
19061906
if (zif->common.type == ZEND_INTERNAL_FUNCTION
19071907
&& zif->internal_function.module == module) {
19081908
if (!array) {

Zend/zend_closures.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static HashTable *zend_closure_get_debug_info(zend_object *object, int *is_temp)
560560

561561
array_init(&val);
562562

563-
ZEND_HASH_FOREACH_STR_KEY_VAL(static_variables, key, var) {
563+
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(static_variables, key, var) {
564564
zval copy;
565565

566566
if (Z_TYPE_P(var) == IS_CONSTANT_AST) {

Zend/zend_compile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ ZEND_API void zend_activate_auto_globals(void) /* {{{ */
17281728
{
17291729
zend_auto_global *auto_global;
17301730

1731-
ZEND_HASH_FOREACH_PTR(CG(auto_globals), auto_global) {
1731+
ZEND_HASH_MAP_FOREACH_PTR(CG(auto_globals), auto_global) {
17321732
if (auto_global->jit) {
17331733
auto_global->armed = 1;
17341734
} else if (auto_global->auto_global_callback) {
@@ -5768,7 +5768,7 @@ static void zend_compile_try(zend_ast *ast) /* {{{ */
57685768
/* label: try { } must not be equal to try { label: } */
57695769
if (CG(context).labels) {
57705770
zend_label *label;
5771-
ZEND_HASH_REVERSE_FOREACH_PTR(CG(context).labels, label) {
5771+
ZEND_HASH_MAP_REVERSE_FOREACH_PTR(CG(context).labels, label) {
57725772
if (label->opline_num == get_next_op_number()) {
57735773
zend_emit_op(NULL, ZEND_NOP, NULL, NULL);
57745774
}
@@ -6440,7 +6440,7 @@ static void zend_compile_attributes(HashTable **attributes, zend_ast *ast, uint3
64406440
}
64416441

64426442
/* Validate attributes in a secondary loop (needed to detect repeated attributes). */
6443-
ZEND_HASH_FOREACH_PTR(*attributes, attr) {
6443+
ZEND_HASH_PACKED_FOREACH_PTR(*attributes, attr) {
64446444
if (attr->offset != offset || NULL == (config = zend_internal_attribute_get(attr->lcname))) {
64456445
continue;
64466446
}
@@ -6881,7 +6881,7 @@ static void compile_implicit_lexical_binds(
68816881
op_array->static_variables = zend_new_array(8);
68826882
}
68836883

6884-
ZEND_HASH_FOREACH_STR_KEY(&info->uses, var_name)
6884+
ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name)
68856885
zval *value = zend_hash_add(
68866886
op_array->static_variables, var_name, &EG(uninitialized_zval));
68876887
uint32_t offset = (uint32_t)((char*)value - (char*)op_array->static_variables->arData);
@@ -6930,7 +6930,7 @@ static void zend_compile_closure_uses(zend_ast *ast) /* {{{ */
69306930
static void zend_compile_implicit_closure_uses(closure_info *info)
69316931
{
69326932
zend_string *var_name;
6933-
ZEND_HASH_FOREACH_STR_KEY(&info->uses, var_name)
6933+
ZEND_HASH_MAP_FOREACH_STR_KEY(&info->uses, var_name)
69346934
zval zv;
69356935
ZVAL_NULL(&zv);
69366936
zend_compile_static_var_common(var_name, &zv, ZEND_BIND_IMPLICIT);

Zend/zend_enum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static void zend_verify_enum_properties(zend_class_entry *ce)
5353
{
5454
zend_property_info *property_info;
5555

56-
ZEND_HASH_FOREACH_PTR(&ce->properties_info, property_info) {
56+
ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, property_info) {
5757
if (zend_string_equals_literal(property_info->name, "name")) {
5858
continue;
5959
}
@@ -192,7 +192,7 @@ static ZEND_NAMED_FUNCTION(zend_enum_cases_func)
192192

193193
array_init(return_value);
194194

195-
ZEND_HASH_FOREACH_PTR(CE_CONSTANTS_TABLE(ce), c) {
195+
ZEND_HASH_MAP_FOREACH_PTR(CE_CONSTANTS_TABLE(ce), c) {
196196
if (!(ZEND_CLASS_CONST_FLAGS(c) & ZEND_CLASS_CONST_IS_CASE)) {
197197
continue;
198198
}

0 commit comments

Comments
 (0)