Skip to content

Commit 2454226

Browse files
committed
Functions must be stored with lowercase keys
1 parent 821bdbd commit 2454226

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

ext/opcache/zend_accelerator_util_funcs.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,17 @@ void zend_accel_move_user_functions(HashTable *src, HashTable *dst)
135135
src->pDestructor = orig_dtor;
136136
}
137137

138-
static int copy_internal_function(zval *zv, HashTable *function_table)
139-
{
140-
zend_internal_function *function = Z_PTR_P(zv);
141-
if (function->type == ZEND_INTERNAL_FUNCTION) {
142-
zend_hash_update_mem(function_table, function->function_name, function, sizeof(zend_internal_function));
143-
}
144-
return 0;
145-
}
146-
147138
void zend_accel_copy_internal_functions(void)
148139
{
149-
zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table));
140+
zend_string *key;
141+
zval *val;
142+
143+
ZEND_HASH_FOREACH_STR_KEY_VAL(CG(function_table), key, val) {
144+
zend_internal_function *function = Z_PTR_P(val);
145+
if (function->type == ZEND_INTERNAL_FUNCTION) {
146+
zend_hash_update_mem(&ZCG(function_table), key, function, sizeof(zend_internal_function));
147+
}
148+
} ZEND_HASH_FOREACH_END();
150149
ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table));
151150
}
152151

0 commit comments

Comments
 (0)