Allow Iterator to be used with current, next, reset, key functions
| From: | David Lundgren | Date: | Wed, 26 Oct 2016 13:42:59 +0000 |
| Subject: | Allow Iterator to be used with current, next, reset, key functions | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-96614@lists.php.net to get a copy of this message | ||
Greetings,
As suggested by several reviewers of a PR[1] I recently submitted, I'd
like to get feedback on letting custom Iterators be used in the current,
next, reset, and key functions. If this is something to move forward
with, I'll need some help with the RFC process.
Recent experiences trying to use these functions with a custom Iterator,
and a bug[2], led me to try and fix this. BC will occur when an object
implementing Iterator is passed to one of the functions, as the
interface methods will be called, instead of returning the objects
properties. The old behavior should be maintained for classes that do
not implement Iterator.
[1] https://github.com/php/php-src/pull/2176
[2] https://bugs.php.net/bug.php?id=49369
Thanks,
Dave
--
David Lundgren
dlundgren@syberisle.net
808.639.0365
GPG: 0x26F54D7F