diff options
author | David Soria Parra <dsp@php.net> | 2013-09-18 15:06:51 +0200 |
---|---|---|
committer | David Soria Parra <dsp@php.net> | 2013-09-18 15:06:51 +0200 |
commit | 94e4c4df86719dbdf265b9d7ccfd1db8cfd32fdf (patch) | |
tree | 346f8b0ce00a53ab2f52c132d2e081f38efa6a56 | |
parent | 2eb566188625162644a186bcb6757f22978c54f9 (diff) | |
parent | 7a24ee13ec74bf3e85970e59dd69db8034ff434c (diff) | |
download | php-git-94e4c4df86719dbdf265b9d7ccfd1db8cfd32fdf.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Revert "EmptyIterator now implements Countable; fixes bug 60577"
-rw-r--r-- | ext/spl/internal/emptyiterator.inc | 13 | ||||
-rw-r--r-- | ext/spl/spl_iterators.c | 12 | ||||
-rw-r--r-- | ext/spl/tests/bug60577.phpt | 8 |
3 files changed, 2 insertions, 31 deletions
diff --git a/ext/spl/internal/emptyiterator.inc b/ext/spl/internal/emptyiterator.inc index d02b15b999..ac80e79581 100644 --- a/ext/spl/internal/emptyiterator.inc +++ b/ext/spl/internal/emptyiterator.inc @@ -15,7 +15,7 @@ * @version 1.0 * @since PHP 5.1 */ -class EmptyIterator implements Iterator, Countable +class EmptyIterator implements Iterator { /** No operation. * @return void @@ -57,15 +57,6 @@ class EmptyIterator implements Iterator, Countable { // nothing to do } - - /** - * @return int - */ - function count() - { - return 0; - } - } -?> +?>
\ No newline at end of file diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 476c64e29d..30532756cb 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -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 }; @@ -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); diff --git a/ext/spl/tests/bug60577.phpt b/ext/spl/tests/bug60577.phpt deleted file mode 100644 index 33fc133d0f..0000000000 --- a/ext/spl/tests/bug60577.phpt +++ /dev/null @@ -1,8 +0,0 @@ ---TEST-- -count(new EmptyIterator) should return zero ---FILE-- -<?php -$it = new EmptyIterator; -var_dump(count($it)); ---EXPECT-- -int(0) |