summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-08-31 20:54:00 +0000
committerMarcus Boerger <helly@php.net>2004-08-31 20:54:00 +0000
commit819127b74b88b75740feccc8cdc860c16e9df54b (patch)
treee16f654e75ac72b5e6ba075ac0ce77e21892e257 /ext/spl/spl_array.c
parent579575e4309268e426fa723f6fda90f2493e4417 (diff)
downloadphp-git-819127b74b88b75740feccc8cdc860c16e9df54b.tar.gz
Fix seeking
Diffstat (limited to 'ext/spl/spl_array.c')
-rwxr-xr-xext/spl/spl_array.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 901bd35552..34645a18ef 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -716,7 +716,7 @@ SPL_METHOD(Array, seek)
zend_hash_internal_pointer_reset_ex(aht, &intern->pos);
- while (position-- > 0 && spl_array_next(intern TSRMLS_CC));
+ while (position-- > 0 && spl_array_next(intern TSRMLS_CC) == SUCCESS);
} /* }}} */
int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
@@ -737,9 +737,8 @@ int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{
pos = intern->pos;
*count = 0;
zend_hash_internal_pointer_reset_ex(aht, &intern->pos);
- while(intern->pos) {
+ while(intern->pos && spl_array_next(intern TSRMLS_CC) == SUCCESS) {
(*count)++;
- spl_array_next(intern TSRMLS_CC);
}
intern->pos = pos;
return SUCCESS;