|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-07-19 12:12 UTC] mateusz dot charytoniuk at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/class.traversable --- It would be interesting if one could add 'implements Traversable' to abstract class and then (in deriving classess) implement it either as Iterator or IteratorAggregate. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 18:00:01 2025 UTC |
This appears to be a bug not a feature request, as it should be possible. e.g. in the code below the userland interface + abstract class is fine. But the internal interface and abstract class is not fine. <?php interface foo { public function bar(); } abstract class b implements foo {} //compiles fine abstract class a implements Traversable {} //PHP Fatal error: Class a must implement interface Traversable as part of either Iterator or IteratorAggregate in Unknown on line 0