diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-10 10:39:22 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-10 10:39:22 +0100 |
commit | d2e10c764d1b8860dd798eda3055fc957ff556ad (patch) | |
tree | 10e6d19cdc71f27e08e0134ad30fe34cd05b7046 /include | |
parent | 49d88d98a0656233f15923d31ea67a1ed229e514 (diff) |
fixed iterators for php 5.3 + updated documentation about iterators
Diffstat (limited to 'include')
-rw-r--r-- | include/iterator.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/iterator.h b/include/iterator.h index 3c8f870..0c64133 100644 --- a/include/iterator.h +++ b/include/iterator.h @@ -74,6 +74,16 @@ private: Value _object; /** + * The current() method that is called by the Zend engine wants a + * pointer-to-pointer-to-a-zval. Because of this, we have to keep the + * current value in memory after the current() method returns because + * the pointer would otherwise fall out of scope. This is (once again) + * odd behavior of the Zend engine, but we'll have to live with that + * @var Value + */ + Value _current; + + /** * Internal method that returns the implementation object * @return zend_object_iterator */ @@ -111,6 +121,16 @@ private: static void key(struct _zend_object_iterator *iter, struct _zval_struct *data); /** + * Function to retrieve the current key, php 5.3 style + * @param iter + * @param str_key + * @param str_key_len + * @param int_key + * @return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG + */ + static int key(struct _zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key); + + /** * Step forwards to the next element * @param iter */ |