diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 23ea50a4e3c..53ad1b01690 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4160,6 +4160,7 @@ static void preload_fix_trait_methods(zend_class_entry *ce) static int preload_optimize(zend_persistent_script *script) { zend_class_entry *ce; + zend_persistent_script *tmp_script; zend_shared_alloc_init_xlat_table(); @@ -4169,8 +4170,8 @@ static int preload_optimize(zend_persistent_script *script) } } ZEND_HASH_FOREACH_END(); - ZEND_HASH_FOREACH_PTR(preload_scripts, script) { - ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) { + ZEND_HASH_FOREACH_PTR(preload_scripts, tmp_script) { + ZEND_HASH_FOREACH_PTR(&tmp_script->script.class_table, ce) { if (ce->ce_flags & ZEND_ACC_TRAIT) { preload_register_trait_methods(ce); }