|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-11-13 22:24 UTC] levim@php.net
[2012-11-13 22:24 UTC] levim@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: levim
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 02:00:01 2025 UTC |
Description: ------------ IteratorIterator has a method `seek` that matches the signature for implementing SeekableIterator, but it doesn't implement the interface. Also, subclasses of IteratorIterator do not inherit the seek method. This breaks the rules for inheritance. I'm not sure how to propose fixing it at this point. This should have been caught before being released. Like much of the SPL, this was not properly thought out and tested. Test script: --------------- $iterator = new IteratorIterator( new EmptyIterator() ); var_dump($iterator instanceof SeekableIterator); var_dump(method_exists($iterator, 'seek'); $iterator = new NoRewindIterator( new EmptyIterator() ); var_dump(method_exists($iterator, 'seek'); Expected result: ---------------- bool(true); bool(true); bool(true); Actual result: -------------- bool(false); bool(true); bool(false);