From: Marcus Boerger Date: Sat, 20 Mar 2004 16:09:42 +0000 (+0000) Subject: Fix return value to match std array func behavior X-Git-Tag: php-5.0.0RC2RC1~286 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af9788eb32f0743b465b8f07fbafd4e2fab998de;p=php Fix return value to match std array func behavior --- diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 278fd038af..e9cba4beae 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -408,7 +408,7 @@ SPL_METHOD(Array, rewind) } /* }}} */ -/* {{{ proto mixed|false ArrayIterator::current() +/* {{{ proto mixed|NULL ArrayIterator::current() Return current array entry */ SPL_METHOD(Array, current) { @@ -424,18 +424,18 @@ SPL_METHOD(Array, current) if (intern->array->is_ref && spl_hash_pos_exists(intern TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - RETURN_FALSE; + return; } if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) == FAILURE) { - RETURN_FALSE; + return; } *return_value = **entry; zval_copy_ctor(return_value); } /* }}} */ -/* {{{ proto mixed|false ArrayIterator::key() +/* {{{ proto mixed|NULL ArrayIterator::key() Return current array key */ SPL_METHOD(Array, key) { @@ -453,7 +453,7 @@ SPL_METHOD(Array, key) if (intern->array->is_ref && spl_hash_pos_exists(intern TSRMLS_CC) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid"); - RETURN_FALSE; + return; } switch (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 0, &intern->pos)) {