diff options
| author | Marcus Boerger <helly@php.net> | 2004-08-31 20:54:00 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-08-31 20:54:00 +0000 |
| commit | 819127b74b88b75740feccc8cdc860c16e9df54b (patch) | |
| tree | e16f654e75ac72b5e6ba075ac0ce77e21892e257 /ext/spl/spl_array.c | |
| parent | 579575e4309268e426fa723f6fda90f2493e4417 (diff) | |
| download | php-git-819127b74b88b75740feccc8cdc860c16e9df54b.tar.gz | |
Fix seeking
Diffstat (limited to 'ext/spl/spl_array.c')
| -rwxr-xr-x | ext/spl/spl_array.c | 5 |
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; |
