Skip to content

Commit

Permalink
Merge branch 'PHP-5.5'
Browse files Browse the repository at this point in the history
* PHP-5.5:
  Revert "EmptyIterator now implements Countable; fixes bug 60577"
  • Loading branch information
dsp committed Sep 18, 2013
2 parents 58c6e05 + 94e4c4d commit dc7015d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 31 deletions.
13 changes: 2 additions & 11 deletions ext/spl/internal/emptyiterator.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @version 1.0
* @since PHP 5.1
*/
class EmptyIterator implements Iterator, Countable
class EmptyIterator implements Iterator
{
/** No operation.
* @return void
Expand Down Expand Up @@ -57,15 +57,6 @@ class EmptyIterator implements Iterator, Countable
{
// nothing to do
}

/**
* @return int
*/
function count()
{
return 0;
}

}

?>
?>
12 changes: 0 additions & 12 deletions ext/spl/spl_iterators.c
Original file line number Diff line number Diff line change
Expand Up @@ -3241,23 +3241,12 @@ SPL_METHOD(EmptyIterator, next)
}
} /* }}} */

/* {{{ proto int EmptyIterator::count()
Does nothing */
SPL_METHOD(EmptyIterator, count)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(0);
} /* }}} */

static const zend_function_entry spl_funcs_EmptyIterator[] = {
SPL_ME(EmptyIterator, rewind, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(EmptyIterator, valid, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(EmptyIterator, key, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(EmptyIterator, current, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(EmptyIterator, next, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(EmptyIterator, count, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
PHP_FE_END
};

Expand Down Expand Up @@ -3718,7 +3707,6 @@ PHP_MINIT_FUNCTION(spl_iterators)

REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator);
REGISTER_SPL_ITERATOR(EmptyIterator);
REGISTER_SPL_IMPLEMENTS(EmptyIterator, Countable);

REGISTER_SPL_SUB_CLASS_EX(RecursiveTreeIterator, RecursiveIteratorIterator, spl_RecursiveTreeIterator_new, spl_funcs_RecursiveTreeIterator);
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_CURRENT", RTIT_BYPASS_CURRENT);
Expand Down
8 changes: 0 additions & 8 deletions ext/spl/tests/bug60577.phpt

This file was deleted.

0 comments on commit dc7015d

Please sign in to comment.