diff --git a/Zend/zend.h b/Zend/zend.h index 55f4f3bed98ba..d568696f2028a 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -188,8 +188,6 @@ struct _zend_class_entry { /* allocated only if class implements Iterator or IteratorAggregate interface */ zend_class_iterator_funcs *iterator_funcs_ptr; - /* allocated only if class implements ArrayAccess interface */ - zend_class_arrayaccess_funcs *arrayaccess_funcs_ptr; /* handlers */ union { diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 3d8cea9f8043b..937ec2e12b677 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -316,7 +316,6 @@ typedef struct _zend_fcall_info_cache { class_container.interfaces = NULL; \ class_container.get_iterator = NULL; \ class_container.iterator_funcs_ptr = NULL; \ - class_container.arrayaccess_funcs_ptr = NULL; \ class_container.dimension_handlers = NULL; \ class_container.info.internal.module = NULL; \ class_container.info.internal.builtin_functions = functions; \ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3a8290bd1429f..fc9a1f517f0af 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2040,7 +2040,6 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_hand ce->create_object = NULL; ce->get_iterator = NULL; ce->iterator_funcs_ptr = NULL; - ce->arrayaccess_funcs_ptr = NULL; ce->get_static_method = NULL; ce->parent = NULL; ce->parent_name = NULL; diff --git a/Zend/zend_dimension_handlers.h b/Zend/zend_dimension_handlers.h index 70d28f3462902..66ab0451573e7 100644 --- a/Zend/zend_dimension_handlers.h +++ b/Zend/zend_dimension_handlers.h @@ -36,11 +36,4 @@ typedef struct _zend_class_dimensions_functions { void (*/* const */ unset_dimension)(zend_object *object, zval *offset); } zend_class_dimensions_functions; -typedef struct _zend_class_arrayaccess_funcs { - zend_function *zf_offsetget; - zend_function *zf_offsetexists; - zend_function *zf_offsetset; - zend_function *zf_offsetunset; -} zend_class_arrayaccess_funcs; - #endif /* ZEND_DIMENSION_HANDLERS_H */ diff --git a/Zend/zend_interfaces_dimension.c b/Zend/zend_interfaces_dimension.c index 9aa09efa2ba4c..1cb3e10f66115 100644 --- a/Zend/zend_interfaces_dimension.c +++ b/Zend/zend_interfaces_dimension.c @@ -261,21 +261,6 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en return SUCCESS; } - ZEND_ASSERT(!class_type->arrayaccess_funcs_ptr && "ArrayAccess funcs already set?"); - zend_class_arrayaccess_funcs *funcs_ptr = class_type->type == ZEND_INTERNAL_CLASS - ? pemalloc(sizeof(zend_class_arrayaccess_funcs), 1) - : zend_arena_alloc(&CG(arena), sizeof(zend_class_arrayaccess_funcs)); - class_type->arrayaccess_funcs_ptr = funcs_ptr; - - funcs_ptr->zf_offsetget = zend_hash_str_find_ptr( - &class_type->function_table, "offsetget", sizeof("offsetget") - 1); - funcs_ptr->zf_offsetexists = zend_hash_str_find_ptr( - &class_type->function_table, "offsetexists", sizeof("offsetexists") - 1); - funcs_ptr->zf_offsetset = zend_hash_str_find_ptr( - &class_type->function_table, "offsetset", sizeof("offsetset") - 1); - funcs_ptr->zf_offsetunset = zend_hash_str_find_ptr( - &class_type->function_table, "offsetunset", sizeof("offsetunset") - 1); - zend_class_dimensions_functions *funcs = NULL; ALLOC_HANDLERS_IF_MISSING(funcs, class_type); diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 9f33179f4fe40..53385251d849f 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -508,9 +508,6 @@ ZEND_API void destroy_zend_class(zval *zv) if (ce->iterator_funcs_ptr) { free(ce->iterator_funcs_ptr); } - if (ce->arrayaccess_funcs_ptr) { - free(ce->arrayaccess_funcs_ptr); - } if (ce->num_interfaces > 0) { free(ce->interfaces); } diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 340478fcf5f86..d9fe0ec9e3462 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -874,14 +874,6 @@ static void zend_file_cache_serialize_class(zval *zv, SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_next); SERIALIZE_PTR(ce->iterator_funcs_ptr); } - - if (ce->arrayaccess_funcs_ptr) { - SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetget); - SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetexists); - SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetset); - SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetunset); - SERIALIZE_PTR(ce->arrayaccess_funcs_ptr); - } if (ce->dimension_handlers) { SERIALIZE_PTR(ce->dimension_handlers->read_dimension); SERIALIZE_PTR(ce->dimension_handlers->has_dimension); @@ -1711,13 +1703,6 @@ static void zend_file_cache_unserialize_class(zval *zv, UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_current); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_next); } - if (ce->arrayaccess_funcs_ptr) { - UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr); - UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetget); - UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetexists); - UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetset); - UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetunset); - } if (ce->dimension_handlers) { UNSERIALIZE_PTR(ce->dimension_handlers); UNSERIALIZE_PTR(ce->dimension_handlers->read_dimension); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index d33430aa488ff..580b5c3025356 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -975,9 +975,6 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce) if (ce->iterator_funcs_ptr) { ce->iterator_funcs_ptr = zend_shared_memdup(ce->iterator_funcs_ptr, sizeof(zend_class_iterator_funcs)); } - if (ce->arrayaccess_funcs_ptr) { - ce->arrayaccess_funcs_ptr = zend_shared_memdup(ce->arrayaccess_funcs_ptr, sizeof(zend_class_arrayaccess_funcs)); - } if (ce->dimension_handlers) { ce->dimension_handlers = zend_shared_memdup(ce->dimension_handlers, sizeof(zend_class_dimensions_functions)); } @@ -1137,14 +1134,6 @@ void zend_update_parent_ce(zend_class_entry *ce) ce->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&ce->function_table, "next", sizeof("next") - 1); } } - - if (ce->arrayaccess_funcs_ptr) { - ZEND_ASSERT(zend_class_implements_interface(ce, zend_ce_arrayaccess)); - ce->arrayaccess_funcs_ptr->zf_offsetget = zend_hash_str_find_ptr(&ce->function_table, "offsetget", sizeof("offsetget") - 1); - ce->arrayaccess_funcs_ptr->zf_offsetexists = zend_hash_str_find_ptr(&ce->function_table, "offsetexists", sizeof("offsetexists") - 1); - ce->arrayaccess_funcs_ptr->zf_offsetset = zend_hash_str_find_ptr(&ce->function_table, "offsetset", sizeof("offsetset") - 1); - ce->arrayaccess_funcs_ptr->zf_offsetunset = zend_hash_str_find_ptr(&ce->function_table, "offsetunset", sizeof("offsetunset") - 1); - } } /* update methods */ diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index d9a634d0b96c3..fc74ce7e86dff 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -481,9 +481,6 @@ void zend_persist_class_entry_calc(zend_class_entry *ce) if (ce->iterator_funcs_ptr) { ADD_SIZE(sizeof(zend_class_iterator_funcs)); } - if (ce->arrayaccess_funcs_ptr) { - ADD_SIZE(sizeof(zend_class_arrayaccess_funcs)); - } if (ce->dimension_handlers) { ADD_SIZE(sizeof(zend_class_dimensions_functions)); }