summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-30 15:59:29 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-30 15:59:29 +0300
commit245422653c97cd1fb6bcd6de725574b37b4b639b (patch)
tree4a5a2f0c83c7458e29b4cb6d9247010c207cf4f0
parent821bdbdfba3d45066b45d506d62b4fb6ab44287b (diff)
downloadphp-git-245422653c97cd1fb6bcd6de725574b37b4b639b.tar.gz
Functions must be stored with lowercase keys
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 27e1a17f92..f2ac334e47 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -135,18 +135,17 @@ void zend_accel_move_user_functions(HashTable *src, HashTable *dst)
src->pDestructor = orig_dtor;
}
-static int copy_internal_function(zval *zv, HashTable *function_table)
-{
- zend_internal_function *function = Z_PTR_P(zv);
- if (function->type == ZEND_INTERNAL_FUNCTION) {
- zend_hash_update_mem(function_table, function->function_name, function, sizeof(zend_internal_function));
- }
- return 0;
-}
-
void zend_accel_copy_internal_functions(void)
{
- zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table));
+ zend_string *key;
+ zval *val;
+
+ ZEND_HASH_FOREACH_STR_KEY_VAL(CG(function_table), key, val) {
+ zend_internal_function *function = Z_PTR_P(val);
+ if (function->type == ZEND_INTERNAL_FUNCTION) {
+ zend_hash_update_mem(&ZCG(function_table), key, function, sizeof(zend_internal_function));
+ }
+ } ZEND_HASH_FOREACH_END();
ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table));
}