Skip to content

Commit 7a24ee1

Browse files
committed
Revert "EmptyIterator now implements Countable; fixes bug 60577"
This reverts commit 8a936e8.
1 parent 7e9044b commit 7a24ee1

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

NEWS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ PHP NEWS
1515
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
1616
(Syra)
1717

18-
- SPL:
19-
. Fixed bug #60577 (count(new EmptyIterator) returns 1). (Levi Morrison)
20-
2118
?? ??? 2013, PHP 5.4.20
2219

2320
- Core:

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
@@ -3279,23 +3279,12 @@ SPL_METHOD(EmptyIterator, next)
32793279
}
32803280
} /* }}} */
32813281

3282-
/* {{{ proto int EmptyIterator::count()
3283-
Does nothing */
3284-
SPL_METHOD(EmptyIterator, count)
3285-
{
3286-
if (zend_parse_parameters_none() == FAILURE) {
3287-
return;
3288-
}
3289-
RETURN_LONG(0);
3290-
} /* }}} */
3291-
32923282
static const zend_function_entry spl_funcs_EmptyIterator[] = {
32933283
SPL_ME(EmptyIterator, rewind, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32943284
SPL_ME(EmptyIterator, valid, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32953285
SPL_ME(EmptyIterator, key, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32963286
SPL_ME(EmptyIterator, current, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32973287
SPL_ME(EmptyIterator, next, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
3298-
SPL_ME(EmptyIterator, count, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
32993288
PHP_FE_END
33003289
};
33013290

@@ -3767,7 +3756,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
37673756

37683757
REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator);
37693758
REGISTER_SPL_ITERATOR(EmptyIterator);
3770-
REGISTER_SPL_IMPLEMENTS(EmptyIterator, Countable);
37713759

37723760
REGISTER_SPL_SUB_CLASS_EX(RecursiveTreeIterator, RecursiveIteratorIterator, spl_RecursiveTreeIterator_new, spl_funcs_RecursiveTreeIterator);
37733761
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)