summaryrefslogtreecommitdiff
path: root/Zend/zend_iterators.h
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2013-02-16 19:13:36 +0100
committerNikita Popov <nikic@php.net>2013-03-12 17:27:31 +0100
commitfcc6611de9054327441786e52444b5f8eecdd525 (patch)
tree072a133a6e3ea1c067d9ad30cb07bb8130691094 /Zend/zend_iterators.h
parent8436342d8861650930f985249ce3da7f92f03506 (diff)
downloadphp-git-fcc6611de9054327441786e52444b5f8eecdd525.tar.gz
Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
Diffstat (limited to 'Zend/zend_iterators.h')
-rw-r--r--Zend/zend_iterators.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h
index b484102b20..f74068a271 100644
--- a/Zend/zend_iterators.h
+++ b/Zend/zend_iterators.h
@@ -38,8 +38,11 @@ typedef struct _zend_object_iterator_funcs {
/* fetch the item data for the current element */
void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC);
- /* fetch the key for the current element (return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG) (optional, may be NULL) */
- int (*get_current_key)(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+ /* fetch the key for the current element (optional, may be NULL). The key
+ * should be written into the provided zval* using the ZVAL_* macros. If
+ * this handler is not provided auto-incrementing integer keys will be
+ * used. */
+ void (*get_current_key)(zend_object_iterator *iter, zval *key TSRMLS_DC);
/* step forwards to next element */
void (*move_forward)(zend_object_iterator *iter TSRMLS_DC);