Optional handler with the same semantics as the object handler.
zend_generator_iterator_get_key,
zend_generator_iterator_move_forward,
zend_generator_iterator_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
zend_user_it_get_current_key,
zend_user_it_move_forward,
zend_user_it_rewind,
- zend_user_it_invalidate_current
+ zend_user_it_invalidate_current,
+ NULL, /* get_gc */
};
/* {{{ zend_user_it_get_iterator */
}
static HashTable *iter_wrapper_get_gc(zend_object *object, zval **table, int *n) {
- /* TODO: We need a get_gc iterator handler */
+ zend_object_iterator *iter = (zend_object_iterator*)object;
+ if (iter->funcs->get_gc) {
+ return iter->funcs->get_gc(iter, table, n);
+ }
+
*table = NULL;
*n = 0;
return NULL;
/* invalidate current value/key (optional, may be NULL) */
void (*invalidate_current)(zend_object_iterator *iter);
+
+ /* Expose owned values to GC.
+ * This has the same semantics as the corresponding object handler. */
+ HashTable *(*get_gc)(zend_object_iterator *iter, zval **table, int *n);
} zend_object_iterator_funcs;
struct _zend_object_iterator {
zend_weakmap_iterator_get_current_key,
zend_weakmap_iterator_move_forward,
zend_weakmap_iterator_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
static zend_object_iterator *zend_weakmap_get_iterator(
com_iter_get_data,
com_iter_get_key,
com_iter_move_forwards,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref)
saproxy_iter_get_data,
saproxy_iter_get_key,
saproxy_iter_move_forwards,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
date_period_it_current_key,
date_period_it_move_forward,
date_period_it_rewind,
- date_period_it_invalidate_current
+ date_period_it_invalidate_current,
+ NULL, /* get_gc */
};
zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
php_dom_iterator_current_key,
php_dom_iterator_move_forward,
NULL,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
zend_ffi_cdata_it_get_current_key,
zend_ffi_cdata_it_move_forward,
zend_ffi_cdata_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
static zend_object_iterator *zend_ffi_cdata_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
resourcebundle_iterator_key,
resourcebundle_iterator_step,
resourcebundle_iterator_reset,
- resourcebundle_iterator_invalidate
+ resourcebundle_iterator_invalidate,
+ NULL, /* get_gc */
};
/* }}} */
php_mysqli_result_iterator_current_key,
php_mysqli_result_iterator_move_forward,
php_mysqli_result_iterator_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
/* }}} */
pdo_stmt_iter_get_key,
pdo_stmt_iter_move_forwards,
NULL,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref)
php_sxe_iterator_current_key,
php_sxe_iterator_move_forward,
php_sxe_iterator_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
/* }}} */
spl_array_it_get_current_key,
spl_array_it_move_forward,
spl_array_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
spl_filesystem_dir_it_current_key,
spl_filesystem_dir_it_move_forward,
spl_filesystem_dir_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
/* }}} */
spl_filesystem_tree_it_current_key,
spl_filesystem_tree_it_move_forward,
spl_filesystem_tree_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
/* }}} */
spl_dllist_it_get_current_key,
spl_dllist_it_move_forward,
spl_dllist_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
}; /* }}} */
zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
spl_fixedarray_it_get_current_key,
spl_fixedarray_it_move_forward,
spl_fixedarray_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
spl_heap_it_get_current_key,
spl_heap_it_move_forward,
spl_heap_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
static const zend_object_iterator_funcs spl_pqueue_it_funcs = {
spl_heap_it_get_current_key,
spl_heap_it_move_forward,
spl_heap_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
spl_recursive_it_get_current_key,
spl_recursive_it_move_forward,
spl_recursive_it_rewind,
- NULL
+ NULL,
+ NULL, /* get_gc */
};
static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref)