php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78167 Make Generators implement the rewind() method
Submitted: 2019-06-14 19:23 UTC Modified: 2019-06-15 02:12 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: abumar2811NOSPAM at mail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 7.4.0alpha1 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-06-14 19:23 UTC] abumar2811NOSPAM at mail dot com
Description:
------------
Why implementing an interface.......... without actually implementing it???

Please make rewind() call the "generator's factory" again, with the same
arguments as the original call.

Either that or remove Iterator from the interfaces implemented by Generator.

Thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-15 02:12 UTC] requinix@php.net
-Status: Open +Status: Wont fix
 [2019-06-15 02:12 UTC] requinix@php.net
No. Generates re-invoking code when rewound would be "magical" and not in the good way. And they definitely need to be iterators because that's half the point of what a generator is, besides the fact that all the other iterator methods are completely reasonable for it to have.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 03:01:30 2024 UTC