[php-src] Issue #8156: Classes extending `SplFixedArray` can not implement `RecursiveIterator`
| From: | ghostwriter | Date: | Mon, 28 Feb 2022 04:37:34 +0000 |
| Subject: | [php-src] Issue #8156: Classes extending `SplFixedArray` can not implement `RecursiveIterator` | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240072@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8156
Comment Author: ghostwriter
Implementing both
Iterator and IteratorAggregate is a problem, because
they are identical behaviors that are interchangeable.
A Fatal error thrown when both Iterator and IteratorAggregate are
implemented on the same class is acceptable.
A Fatal error thrown when an IteratorAggregate and an interface that extends
Iterator is implemented on the same class is undesired. eg
RecursiveIterator
* why is implementing IteratorAggregate not sufficient for
RecursiveIterator's request for an Iterator?
* was this change in behavior discussed anywhere? to read and learn why this current behavior is
preferable.
* why is this behavior is not documented, if it is in fact the intended behavior? if "help
wanted", where can we find instructions on how we can contribute?
If you're willing to discuss, reopen this issue.