union _zend_function *serialize_func;
union _zend_function *unserialize_func;
- zend_class_iterator_funcs iterator_funcs;
+ /* allocated only if class implements Itetrator or IteratorAggregate interface */
+ zend_class_iterator_funcs *iterator_funcs_ptr;
/* handlers */
zend_object* (*create_object)(zend_class_entry *class_type);
#define INIT_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions) \
{ \
+ memset(&class_container, 0, sizeof(zend_class_entry)); \
class_container.name = zend_string_init_interned(class_name, class_name_len, 1); \
- INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions) \
+ class_container.info.internal.builtin_functions = functions; \
}
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions) \
class_container.trait_precedences = NULL; \
class_container.interfaces = NULL; \
class_container.get_iterator = NULL; \
- class_container.iterator_funcs.funcs = NULL; \
+ class_container.iterator_funcs_ptr = NULL; \
class_container.info.internal.module = NULL; \
class_container.info.internal.builtin_functions = functions; \
}
ce->__tostring = NULL;
ce->create_object = NULL;
ce->get_iterator = NULL;
- ce->iterator_funcs.funcs = NULL;
+ ce->iterator_funcs_ptr = NULL;
ce->interface_gets_implemented = NULL;
ce->get_static_method = NULL;
ce->parent = NULL;
/* get_iterator has to be assigned *after* implementing the inferface */
zend_class_implements(zend_ce_generator, 1, zend_ce_iterator);
zend_ce_generator->get_iterator = zend_generator_get_iterator;
- zend_ce_generator->iterator_funcs.funcs = &zend_generator_iterator_functions;
memcpy(&zend_generator_handlers, &std_object_handlers, sizeof(zend_object_handlers));
zend_generator_handlers.free_obj = zend_generator_free_storage;
if (EXPECTED(!ce->get_iterator)) {
ce->get_iterator = ce->parent->get_iterator;
}
- if (EXPECTED(!ce->iterator_funcs.funcs)) {
- ce->iterator_funcs.funcs = ce->parent->iterator_funcs.funcs;
+ if (EXPECTED(!ce->iterator_funcs_ptr) && UNEXPECTED(ce->parent->iterator_funcs_ptr)) {
+ if (ce->type == ZEND_INTERNAL_CLASS) {
+ ce->iterator_funcs_ptr = calloc(1, sizeof(zend_class_iterator_funcs));
+ if (ce->parent->iterator_funcs_ptr->zf_new_iterator) {
+ ce->iterator_funcs_ptr->zf_new_iterator = zend_hash_str_find_ptr(&ce->function_table, "getiterator", sizeof("getiterator") - 1);
+ }
+ if (ce->parent->iterator_funcs_ptr->zf_current) {
+ ce->iterator_funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&ce->function_table, "rewind", sizeof("rewind") - 1);
+ ce->iterator_funcs_ptr->zf_valid = zend_hash_str_find_ptr(&ce->function_table, "valid", sizeof("valid") - 1);
+ ce->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&ce->function_table, "key", sizeof("key") - 1);
+ ce->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&ce->function_table, "current", sizeof("current") - 1);
+ ce->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&ce->function_table, "next", sizeof("next") - 1);
+ }
+ } else {
+ ce->iterator_funcs_ptr = zend_arena_alloc(&CG(arena), sizeof(zend_class_iterator_funcs));
+ memset(ce->iterator_funcs_ptr, 0, sizeof(zend_class_iterator_funcs));
+ }
}
if (EXPECTED(!ce->__get)) {
ce->__get = ce->parent->__get;
/* {{{ zend_user_it_new_iterator */
ZEND_API void zend_user_it_new_iterator(zend_class_entry *ce, zval *object, zval *retval)
{
- zend_call_method_with_0_params(object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", retval);
+ zend_call_method_with_0_params(object, ce, &ce->iterator_funcs_ptr->zf_new_iterator, "getiterator", retval);
}
/* }}} */
zval more;
int result;
- zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
+ zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_valid, "valid", &more);
if (Z_TYPE(more) != IS_UNDEF) {
result = i_zend_is_true(&more);
zval_ptr_dtor(&more);
zval *object = &iter->it.data;
if (Z_ISUNDEF(iter->value)) {
- zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value);
+ zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_current, "current", &iter->value);
}
return &iter->value;
}
zval *object = &iter->it.data;
zval retval;
- zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
+ zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_key, "key", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
ZVAL_ZVAL(key, &retval, 1, 1);
zval *object = &iter->it.data;
zend_user_it_invalidate_current(_iter);
- zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL);
+ zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_next, "next", NULL);
}
/* }}} */
zval *object = &iter->it.data;
zend_user_it_invalidate_current(_iter);
- zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL);
+ zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_rewind, "rewind", NULL);
}
/* }}} */
zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->it.data, object);
- iterator->it.funcs = ce->iterator_funcs.funcs;
+ iterator->it.funcs = &zend_interface_iterator_funcs_iterator;
iterator->ce = Z_OBJCE_P(object);
ZVAL_UNDEF(&iterator->value);
return (zend_object_iterator*)iterator;
}
}
}
- class_type->iterator_funcs.zf_new_iterator = NULL;
class_type->get_iterator = zend_user_it_get_new_iterator;
+ if (class_type->iterator_funcs_ptr != NULL) {
+ class_type->iterator_funcs_ptr->zf_new_iterator = NULL;
+ } else if (class_type->type == ZEND_INTERNAL_CLASS) {
+ class_type->iterator_funcs_ptr = calloc(1, sizeof(zend_class_iterator_funcs));
+ } else {
+ class_type->iterator_funcs_ptr = zend_arena_alloc(&CG(arena), sizeof(zend_class_iterator_funcs));
+ memset(class_type->iterator_funcs_ptr, 0, sizeof(zend_class_iterator_funcs));
+ }
+ if (class_type->type == ZEND_INTERNAL_CLASS) {
+ class_type->iterator_funcs_ptr->zf_new_iterator = zend_hash_str_find_ptr(&class_type->function_table, "getiterator", sizeof("getiterator") - 1);
+ }
return SUCCESS;
}
/* }}} */
}
}
class_type->get_iterator = zend_user_it_get_iterator;
- class_type->iterator_funcs.zf_valid = NULL;
- class_type->iterator_funcs.zf_current = NULL;
- class_type->iterator_funcs.zf_key = NULL;
- class_type->iterator_funcs.zf_next = NULL;
- class_type->iterator_funcs.zf_rewind = NULL;
- if (!class_type->iterator_funcs.funcs) {
- class_type->iterator_funcs.funcs = &zend_interface_iterator_funcs_iterator;
+ if (class_type->iterator_funcs_ptr != NULL) {
+ class_type->iterator_funcs_ptr->zf_valid = NULL;
+ class_type->iterator_funcs_ptr->zf_current = NULL;
+ class_type->iterator_funcs_ptr->zf_key = NULL;
+ class_type->iterator_funcs_ptr->zf_next = NULL;
+ class_type->iterator_funcs_ptr->zf_rewind = NULL;
+ } else if (class_type->type == ZEND_INTERNAL_CLASS) {
+ class_type->iterator_funcs_ptr = calloc(1, sizeof(zend_class_iterator_funcs));
+ } else {
+ class_type->iterator_funcs_ptr = zend_arena_alloc(&CG(arena), sizeof(zend_class_iterator_funcs));
+ memset(class_type->iterator_funcs_ptr, 0, sizeof(zend_class_iterator_funcs));
+ }
+ if (class_type->type == ZEND_INTERNAL_CLASS) {
+ class_type->iterator_funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1);
+ class_type->iterator_funcs_ptr->zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1);
+ class_type->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1);
+ class_type->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1);
+ class_type->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1);
}
return SUCCESS;
}
};
typedef struct _zend_class_iterator_funcs {
- const zend_object_iterator_funcs *funcs;
union _zend_function *zf_new_iterator;
union _zend_function *zf_valid;
union _zend_function *zf_current;
} ZEND_HASH_FOREACH_END();
zend_hash_destroy(&ce->constants_table);
}
+ if (ce->iterator_funcs_ptr) {
+ free(ce->iterator_funcs_ptr);
+ }
if (ce->num_interfaces > 0) {
free(ce->interfaces);
}
ce_period.create_object = date_object_new_period;
date_ce_period = zend_register_internal_class_ex(&ce_period, NULL);
date_ce_period->get_iterator = date_object_period_get_iterator;
- date_ce_period->iterator_funcs.funcs = &date_period_it_funcs;
zend_class_implements(date_ce_period, 1, zend_ce_traversable);
memcpy(&date_object_handlers_period, &std_object_handlers, sizeof(zend_object_handlers));
date_object_handlers_period.offset = XtOffsetOf(php_period_obj, std);
zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC);
zend_declare_property_null(ce, "type", sizeof("type") - 1, ZEND_ACC_PUBLIC);
mysqli_result_class_entry->get_iterator = php_mysqli_result_get_iterator;
- mysqli_result_class_entry->iterator_funcs.funcs = &php_mysqli_result_iterator_funcs;
zend_class_implements(mysqli_result_class_entry, 1, zend_ce_traversable);
zend_hash_add_ptr(&classes, ce->name, &mysqli_result_properties);
php_sxe_object *sxe;
} php_sxe_iterator;
+PHP_SXE_API void php_sxe_rewind_iterator(php_sxe_object *sxe);
+PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe);
+
#endif /* PHP_SIMPLEXML_EXPORTS_H */
/**
}
/* }}} */
+PHP_SXE_API void php_sxe_rewind_iterator(php_sxe_object *sxe) /* {{{ */
+{
+ php_sxe_reset_iterator(sxe, 1);
+}
+/* }}} */
+
static void php_sxe_iterator_rewind(zend_object_iterator *iter) /* {{{ */
{
php_sxe_object *sxe;
sxe.create_object = sxe_object_new;
sxe_class_entry = zend_register_internal_class(&sxe);
sxe_class_entry->get_iterator = php_sxe_get_iterator;
- sxe_class_entry->iterator_funcs.funcs = &php_sxe_iterator_funcs;
zend_class_implements(sxe_class_entry, 1, zend_ce_traversable);
memcpy(&sxe_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
Rewind to first element */
PHP_METHOD(ce_SimpleXMLIterator, rewind)
{
- php_sxe_iterator iter;
-
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- iter.sxe = Z_SXEOBJ_P(getThis());
- ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter);
+ php_sxe_rewind_iterator(Z_SXEOBJ_P(getThis()));
}
/* }}} */
Move to next element */
PHP_METHOD(ce_SimpleXMLIterator, next)
{
- php_sxe_iterator iter;
-
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- iter.sxe = Z_SXEOBJ_P(getThis());
- ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter);
+ php_sxe_move_forward_iterator(Z_SXEOBJ_P(getThis()));
}
/* }}} */
/* Cache iterator functions if ArrayIterator or derived. Check current's */
/* cache since only current is always required */
if (intern->std.handlers == &spl_handler_ArrayIterator) {
- if (!class_type->iterator_funcs.zf_current) {
- class_type->iterator_funcs.zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1);
- class_type->iterator_funcs.zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1);
- class_type->iterator_funcs.zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1);
- class_type->iterator_funcs.zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1);
- class_type->iterator_funcs.zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1);
+ if (!class_type->iterator_funcs_ptr->zf_current) {
+ class_type->iterator_funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1);
+ class_type->iterator_funcs_ptr->zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1);
+ class_type->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1);
+ class_type->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1);
+ class_type->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1);
}
if (inherited) {
- if (class_type->iterator_funcs.zf_rewind->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_REWIND;
- if (class_type->iterator_funcs.zf_valid->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_VALID;
- if (class_type->iterator_funcs.zf_key->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_KEY;
- if (class_type->iterator_funcs.zf_current->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_CURRENT;
- if (class_type->iterator_funcs.zf_next->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_NEXT;
+ if (class_type->iterator_funcs_ptr->zf_rewind->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_REWIND;
+ if (class_type->iterator_funcs_ptr->zf_valid->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_VALID;
+ if (class_type->iterator_funcs_ptr->zf_key->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_KEY;
+ if (class_type->iterator_funcs_ptr->zf_current->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_CURRENT;
+ if (class_type->iterator_funcs_ptr->zf_next->common.scope != parent) intern->ar_flags |= SPL_ARRAY_OVERLOADED_NEXT;
}
}
php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray");
}
- if (!class_type->iterator_funcs.zf_current) {
- class_type->iterator_funcs.zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1);
- class_type->iterator_funcs.zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1);
- class_type->iterator_funcs.zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1);
- class_type->iterator_funcs.zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1);
- class_type->iterator_funcs.zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1);
+ if (!class_type->iterator_funcs_ptr->zf_current) {
+ class_type->iterator_funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&class_type->function_table, "rewind", sizeof("rewind") - 1);
+ class_type->iterator_funcs_ptr->zf_valid = zend_hash_str_find_ptr(&class_type->function_table, "valid", sizeof("valid") - 1);
+ class_type->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&class_type->function_table, "key", sizeof("key") - 1);
+ class_type->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&class_type->function_table, "current", sizeof("current") - 1);
+ class_type->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&class_type->function_table, "next", sizeof("next") - 1);
}
if (inherited) {
- if (class_type->iterator_funcs.zf_rewind->common.scope != parent) {
+ if (class_type->iterator_funcs_ptr->zf_rewind->common.scope != parent) {
intern->flags |= SPL_FIXEDARRAY_OVERLOADED_REWIND;
}
- if (class_type->iterator_funcs.zf_valid->common.scope != parent) {
+ if (class_type->iterator_funcs_ptr->zf_valid->common.scope != parent) {
intern->flags |= SPL_FIXEDARRAY_OVERLOADED_VALID;
}
- if (class_type->iterator_funcs.zf_key->common.scope != parent) {
+ if (class_type->iterator_funcs_ptr->zf_key->common.scope != parent) {
intern->flags |= SPL_FIXEDARRAY_OVERLOADED_KEY;
}
- if (class_type->iterator_funcs.zf_current->common.scope != parent) {
+ if (class_type->iterator_funcs_ptr->zf_current->common.scope != parent) {
intern->flags |= SPL_FIXEDARRAY_OVERLOADED_CURRENT;
}
- if (class_type->iterator_funcs.zf_next->common.scope != parent) {
+ if (class_type->iterator_funcs_ptr->zf_next->common.scope != parent) {
intern->flags |= SPL_FIXEDARRAY_OVERLOADED_NEXT;
}
spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
+static const zend_object_iterator_funcs spl_recursive_it_iterator_funcs = {
+ spl_recursive_it_dtor,
+ spl_recursive_it_valid,
+ spl_recursive_it_get_current_data,
+ spl_recursive_it_get_current_key,
+ spl_recursive_it_move_forward,
+ spl_recursive_it_rewind,
+ NULL
+};
+
static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref)
{
spl_recursive_it_iterator *iterator;
zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.data, zobject);
- iterator->intern.funcs = ce->iterator_funcs.funcs;
+ iterator->intern.funcs = &spl_recursive_it_iterator_funcs;
return (zend_object_iterator*)iterator;
}
-static const zend_object_iterator_funcs spl_recursive_it_iterator_funcs = {
- spl_recursive_it_dtor,
- spl_recursive_it_valid,
- spl_recursive_it_get_current_data,
- spl_recursive_it_get_current_key,
- spl_recursive_it_move_forward,
- spl_recursive_it_rewind,
- NULL
-};
-
static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_base, zend_class_entry *ce_inner, recursive_it_it_type rit_type)
{
zval *object = getThis();
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) {
if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) {
- zend_call_method_with_0_params(iterator, Z_OBJCE_P(iterator), &Z_OBJCE_P(iterator)->iterator_funcs.zf_new_iterator, "getiterator", &aggregate_retval);
+ zend_call_method_with_0_params(iterator, Z_OBJCE_P(iterator), &Z_OBJCE_P(iterator)->iterator_funcs_ptr->zf_new_iterator, "getiterator", &aggregate_retval);
iterator = &aggregate_retval;
} else {
Z_ADDREF_P(iterator);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|ll", &iterator, &mode, &flags) == SUCCESS) {
if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) {
- zend_call_method_with_0_params(iterator, Z_OBJCE_P(iterator), &Z_OBJCE_P(iterator)->iterator_funcs.zf_new_iterator, "getiterator", &aggregate_retval);
+ zend_call_method_with_0_params(iterator, Z_OBJCE_P(iterator), &Z_OBJCE_P(iterator)->iterator_funcs_ptr->zf_new_iterator, "getiterator", &aggregate_retval);
iterator = &aggregate_retval;
} else {
Z_ADDREF_P(iterator);
#if MBO_0
static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type)
{
- class_type->iterator_funcs.zf_valid = NULL;
- class_type->iterator_funcs.zf_current = NULL;
- class_type->iterator_funcs.zf_key = NULL;
- class_type->iterator_funcs.zf_next = NULL;
- class_type->iterator_funcs.zf_rewind = NULL;
- if (!class_type->iterator_funcs.funcs) {
- class_type->iterator_funcs.funcs = &zend_interface_iterator_funcs_iterator;
- }
+ class_type->iterator_funcs_ptr->zf_valid = NULL;
+ class_type->iterator_funcs_ptr->zf_current = NULL;
+ class_type->iterator_funcs_ptr->zf_key = NULL;
+ class_type->iterator_funcs_ptr->zf_next = NULL;
+ class_type->iterator_funcs_ptr->zf_rewind = NULL;
return SUCCESS;
}
ce = ce_cast;
}
if (instanceof_function(ce, zend_ce_aggregate)) {
- zend_call_method_with_0_params(zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
+ zend_call_method_with_0_params(zobject, ce, &ce->iterator_funcs_ptr->zf_new_iterator, "getiterator", &retval);
if (EG(exception)) {
zval_ptr_dtor(&retval);
return NULL;
spl_handlers_dual_it.free_obj = spl_dual_it_free_storage;
spl_ce_RecursiveIteratorIterator->get_iterator = spl_recursive_it_get_iterator;
- spl_ce_RecursiveIteratorIterator->iterator_funcs.funcs = &spl_recursive_it_iterator_funcs;
REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "LEAVES_ONLY", RIT_LEAVES_ONLY);
REGISTER_SPL_CLASS_CONST_LONG(RecursiveIteratorIterator, "SELF_FIRST", RIT_SELF_FIRST);
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !EG(exception)) {
it = &element->obj;
- zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_rewind, "rewind", NULL);
+ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs_ptr->zf_rewind, "rewind", NULL);
zend_hash_move_forward_ex(&intern->storage, &intern->pos);
}
}
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !EG(exception)) {
it = &element->obj;
- zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_next, "next", NULL);
+ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs_ptr->zf_next, "next", NULL);
zend_hash_move_forward_ex(&intern->storage, &intern->pos);
}
}
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !EG(exception)) {
it = &element->obj;
- zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_valid, "valid", &retval);
+ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs_ptr->zf_valid, "valid", &retval);
if (!Z_ISUNDEF(retval)) {
valid = (Z_TYPE(retval) == IS_TRUE);
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL && !EG(exception)) {
it = &element->obj;
- zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_valid, "valid", &retval);
+ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs_ptr->zf_valid, "valid", &retval);
if (!Z_ISUNDEF(retval)) {
valid = Z_TYPE(retval) == IS_TRUE;
if (valid) {
if (SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT == get_type) {
- zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_current, "current", &retval);
+ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs_ptr->zf_current, "current", &retval);
} else {
- zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_key, "key", &retval);
+ zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs_ptr->zf_key, "key", &retval);
}
if (Z_ISUNDEF(retval)) {
zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0);