From: Felipe Pena Date: Tue, 20 Jan 2009 00:47:03 +0000 (+0000) Subject: - MFH: Added missing "return;" X-Git-Tag: php-5.2.9RC1~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3404865719d6f3ac238473b12f07f1b1891fc050;p=php - MFH: Added missing "return;" --- diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 6a64bb74cf..1e1757f65d 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -2030,6 +2030,7 @@ SPL_METHOD(CachingIterator, __toString) if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); + return; } if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) { if (intern->current.key_type == HASH_KEY_IS_STRING) { @@ -2066,6 +2067,7 @@ SPL_METHOD(CachingIterator, offsetSet) if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); + return; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &arKey, &nKeyLength, &value) == FAILURE) { @@ -2090,6 +2092,7 @@ SPL_METHOD(CachingIterator, offsetGet) if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); + return; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arKey, &nKeyLength) == FAILURE) { @@ -2117,6 +2120,7 @@ SPL_METHOD(CachingIterator, offsetUnset) if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); + return; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arKey, &nKeyLength) == FAILURE) { @@ -2139,6 +2143,7 @@ SPL_METHOD(CachingIterator, offsetExists) if (!(intern->u.caching.flags & CIT_FULL_CACHE)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name); + return; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arKey, &nKeyLength) == FAILURE) { diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt index d3c625314f..febf49594f 100755 --- a/ext/spl/tests/iterator_044.phpt +++ b/ext/spl/tests/iterator_044.phpt @@ -72,8 +72,6 @@ $it->test($checks); --EXPECTF-- Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) - -Notice: Undefined index: 0 in %siterator_044.php on line %d Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) Warning: CachingIterator::offsetExists() expects exactly 1 parameter, 0 given in %siterator_044.php on line %d