]> granicus.if.org Git - php/commitdiff
- MFH: Added missing "return;"
authorFelipe Pena <felipe@php.net>
Tue, 20 Jan 2009 00:47:03 +0000 (00:47 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 20 Jan 2009 00:47:03 +0000 (00:47 +0000)
ext/spl/spl_iterators.c
ext/spl/tests/iterator_044.phpt

index 6a64bb74cf6e5818a6cdb53b48cb641e9ac244d9..1e1757f65da867e83bb0a223a6e42ac5b898b959 100755 (executable)
@@ -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) {
index d3c625314f5ca593a118ed5c0d5c2751f4d2c4f0..febf49594f395045b9b3400d82aa11afe689e3d3 100755 (executable)
@@ -72,8 +72,6 @@ $it->test($checks);
 <?php exit(0); ?>
 --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