Req #62609 [Com]: Traversable Interface

From: Date: Fri, 09 Jan 2015 01:18:54 +0000
Subject: Req #62609 [Com]: Traversable Interface
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189815@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62609&edit=1 ID: 62609 Comment by: danack@php.net Reported by: mateusz dot charytoniuk at gmail dot com Summary: Traversable Interface Status: Open Type: Feature/Change Request Package: SPL related Operating System: Debian wheezy/sid 3.2.0-3-amd64 PHP Version: 5.4.4 Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2012-07-19 12:12:30] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62609&edit=1

« previous php.bugs (#189815) next »