Edit report at https://bugs.php.net/bug.php?id=63507&edit=1

 ID:                 63507
 Updated by:         le...@php.net
 Reported by:        le...@php.net
 Summary:            IteratorIterator inheritance problems
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            SPL related
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        levim
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

I seem to have tested the wrong things, somehow.  Silly mistake.


Previous Comments:
------------------------------------------------------------------------
[2012-11-13 22:12:23] le...@php.net

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);


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63507&edit=1

Reply via email to