diff options
author | Marcus Boerger <helly@php.net> | 2004-01-25 13:32:02 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-01-25 13:32:02 +0000 |
commit | 6e2cf148a447bf8f6ce9a8c788ee4b77b69ed444 (patch) | |
tree | 6eebbb90c5922912d8eba0589d250922fa2f038d /Zend/zend_iterators.c | |
parent | db864753673ad8c67cb5169c794b49dbd848ff63 (diff) | |
download | php-git-6e2cf148a447bf8f6ce9a8c788ee4b77b69ed444.tar.gz |
Respect proeprty visibility in foreach
Diffstat (limited to 'Zend/zend_iterators.c')
-rwxr-xr-x | Zend/zend_iterators.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c index 4d08c504e6..55b67a064a 100755 --- a/Zend/zend_iterators.c +++ b/Zend/zend_iterators.c @@ -81,15 +81,19 @@ ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap( *iter = (zend_object_iterator *)zend_object_store_get_object(array_ptr TSRMLS_CC); return ZEND_ITER_OBJECT; } - /* Until we have a default iterator that respects visibility we do the array trick */ - /*return ZEND_ITER_INVALID*/; + if (HASH_OF(array_ptr)) { + return ZEND_ITER_PLAIN_OBJECT; + } + return ZEND_ITER_INVALID; + case IS_ARRAY: - *iter = NULL; - return HASH_OF(array_ptr) ? ZEND_ITER_PLAIN_ARRAY : ZEND_ITER_INVALID; + if (HASH_OF(array_ptr)) { + return ZEND_ITER_PLAIN_ARRAY; + } + return ZEND_ITER_INVALID; default: - *iter = NULL; return ZEND_ITER_INVALID; } } |