diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-02-26 15:01:08 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-02-26 15:01:08 +0400 |
| commit | 495551aa8c3d66ee16ab91c1fb97329f10c0632c (patch) | |
| tree | 19f39597305afd611b7a6788964f7f14ff120208 /ext/spl/spl_heap.c | |
| parent | a4a86df3c0c47362a6932585a447f87dc9823451 (diff) | |
| download | php-git-495551aa8c3d66ee16ab91c1fb97329f10c0632c.tar.gz | |
Fixed iterators API. zend_iterator_init() has to be used in each get_iterator() callback.
Diffstat (limited to 'ext/spl/spl_heap.c')
| -rw-r--r-- | ext/spl/spl_heap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 9159000799..2afee6cd49 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -1091,6 +1091,9 @@ zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, Z_ADDREF_P(object); iterator = emalloc(sizeof(spl_heap_it)); + + zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + iterator->intern.it.data = (void*)object; iterator->intern.it.funcs = &spl_heap_it_funcs; iterator->intern.ce = ce; @@ -1115,6 +1118,9 @@ zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object Z_ADDREF_P(object); iterator = emalloc(sizeof(spl_heap_it)); + + zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + iterator->intern.it.data = (void*)object; iterator->intern.it.funcs = &spl_pqueue_it_funcs; iterator->intern.ce = ce; |
