diff options
author | Marcus Boerger <helly@php.net> | 2003-10-18 18:43:31 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-10-18 18:43:31 +0000 |
commit | b0b82541e84e88a2e66b8a2239610c257ce6e475 (patch) | |
tree | a70911cdd0985292cba1dd33344aa932c7b3752c /Zend | |
parent | 15bfbc7619e3560151e70619fde66fb1a0f0404e (diff) | |
download | php-git-b0b82541e84e88a2e66b8a2239610c257ce6e475.tar.gz |
Fix class/iterator relationship & handling
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend.h | 2 | ||||
-rw-r--r-- | Zend/zend_API.h | 2 | ||||
-rw-r--r-- | Zend/zend_compile.c | 6 | ||||
-rwxr-xr-x | Zend/zend_iterators.h | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/Zend/zend.h b/Zend/zend.h index 20c36fd8bb..4317f75373 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -333,7 +333,7 @@ struct _zend_class_entry { union _zend_function *__set; union _zend_function *__call; - zend_class_iterator_funcs *iterator_funcs; + zend_class_iterator_funcs iterator_funcs; /* handlers */ zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 5fd3d3ea82..d7b9a44390 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -126,7 +126,7 @@ typedef struct _zend_function_entry { class_container.__set = handle_propset; \ class_container.num_interfaces = 0; \ class_container.get_iterator = NULL; \ - class_container.iterator_funcs = NULL; \ + class_container.iterator_funcs.funcs = NULL; \ } int zend_next_free_module(void); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 6df8fc3554..f0e73b3e07 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1608,6 +1608,12 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) ce->create_object = ce->parent->create_object; /* Inherit special functions if needed */ + if (!ce->get_iterator) { + ce->get_iterator = ce->parent->get_iterator; + } + if (!ce->iterator_funcs.funcs) { + ce->iterator_funcs.funcs = ce->parent->iterator_funcs.funcs; + } if (!ce->__get) { ce->__get = ce->parent->__get; } diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index bd62cc0c8d..4a05fdd942 100755 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -56,7 +56,7 @@ struct _zend_object_iterator { typedef zval *(*zend_object_new_iterator_t)(zend_class_entry *ce, zval *object TSRMLS_DC); typedef struct _zend_class_iterator_funcs { - zend_object_iterator_funcs funcs; + zend_object_iterator_funcs *funcs; zend_object_new_iterator_t new_iterator; union _zend_function *zf_new_iterator; union _zend_function *zf_has_more; |