#29901 [Opn->Bgs]: can't extend class that implements both IteratorAggregate and Iterator

From: Date: Mon, 30 Aug 2004 18:52:41 +0000
Subject: #29901 [Opn->Bgs]: can't extend class that implements both IteratorAggregate and Iterator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65472@lists.php.net to get a copy of this message
ID: 29901 Updated by: helly@php.net Reported By: nad at datapro dot lv -Status: Open +Status: Bogus Bug Type: Reproducible crash Operating System: Windows 2000 PHP Version: 5.0.1 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Wrong code. Never extend from both Iterator and IteratorAccess. Previous Comments: ------------------------------------------------------------------------ [2004-08-30 19:18:19] nad at datapro dot lv Description: ------------ Fatal error: Class FooExtra could not implement interface IteratorAggregate in Unknown on line 0 Reproduce code: --------------- class Foo implements IteratorAggregate, Iterator { function rewind(){} function hasMore() {} function key() {} function current(){} function next() {} function valid() {} function getIterator() { return $this;} } class FooExtra extends Foo { function valid() {} } Actual result: -------------- Fatal error: Class FooExtra could not implement interface IteratorAggregate in Unknown on line 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29901&edit=1

« previous php.bugs (#65472) next »