Skip to content

Commit dc7015d

Browse files
committed
Merge branch 'PHP-5.5'
* PHP-5.5: Revert "EmptyIterator now implements Countable; fixes bug 60577"
2 parents 58c6e05 + 94e4c4d commit dc7015d

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

ext/spl/internal/emptyiterator.inc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @version 1.0
1616
* @since PHP 5.1
1717
*/
18-
class EmptyIterator implements Iterator, Countable
18+
class EmptyIterator implements Iterator
1919
{
2020
/** No operation.
2121
* @return void
@@ -57,15 +57,6 @@ class EmptyIterator implements Iterator, Countable
5757
{
5858
// nothing to do
5959
}
60-
61-
/**
62-
* @return int
63-
*/
64-
function count()
65-
{
66-
return 0;
67-
}
68-
6960
}
7061

71-
?>
62+
?>

ext/spl/spl_iterators.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,23 +3241,12 @@ SPL_METHOD(EmptyIterator, next)
32413241
}
32423242
} /* }}} */
32433243

3244-
/* {{{ proto int EmptyIterator::count()
3245-
Does nothing */
3246-
SPL_METHOD(EmptyIterator, count)
3247-
{
3248-
if (zend_parse_parameters_none() == FAILURE) {
3249-
return;
3250-
}
3251-
RETURN_LONG(0);
3252-
} /* }}} */
3253-
32543244
static const zend_function_entry spl_funcs_EmptyIterator[] = {
32553245
SPL_ME(EmptyIterator, rewind, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32563246
SPL_ME(EmptyIterator, valid, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32573247
SPL_ME(EmptyIterator, key, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32583248
SPL_ME(EmptyIterator, current, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32593249
SPL_ME(EmptyIterator, next, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
3260-
SPL_ME(EmptyIterator, count, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32613250
PHP_FE_END
32623251
};
32633252

@@ -3718,7 +3707,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
37183707

37193708
REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator);
37203709
REGISTER_SPL_ITERATOR(EmptyIterator);
3721-
REGISTER_SPL_IMPLEMENTS(EmptyIterator, Countable);
37223710

37233711
REGISTER_SPL_SUB_CLASS_EX(RecursiveTreeIterator, RecursiveIteratorIterator, spl_RecursiveTreeIterator_new, spl_funcs_RecursiveTreeIterator);
37243712
REGISTER_SPL_CLASS_CONST_LONG(RecursiveTreeIterator, "BYPASS_CURRENT", RTIT_BYPASS_CURRENT);

ext/spl/tests/bug60577.phpt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)