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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: abumar2811NOSPAM at mail dot com
New email:
PHP Version: OS:

 

 [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 17 07:01:32 2024 UTC