From: uramihsayibok at gmail dot com Operating system: Windows XP PHP version: 5.2.10 PHP Bug Type: Class/Object related Bug description: "could not implement" - NOT redefining functions
Description: ------------ When trying to make a class that implements IteratorAggregate and SPL's SeekableIterator the order of the interfaces in the list matters. One order (IA first SI second) works while the other (SI first IA second) produces a fatal error in Unknown. THESE TWO INTERFACES ARE SEPARATE AND DISTINCT - NO FUNCTIONS IN COMMON! Traversable -> Iterator -> SeekableIterator (seek,current,next,key,valid,rewind) Traversable -> IteratorAggregate (getIterator) I haven't been able to reproduce this with user-defined interfaces and I haven't gone looking to see if this happens with any other built-in interfaces. Something to do with that fact that they redefine how iteration on a class works? Reproduce code: --------------- #1 (works) abstract class Foo1 implements IteratorAggregate, SeekableIterator {} #2 (does not work) abstract class Foo2 implements SeekableIterator, IteratorAggregate {} Expected result: ---------------- #1 and #2 should both work or both not work. In this case, work, since neither have any functions in common to redefine. Actual result: -------------- #1 - okay #2 - "Fatal error: Class Foo2 could not implement interface IteratorAggregate in Unknown on line 0" -- Edit bug report at http://bugs.php.net/?id=48667&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48667&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48667&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48667&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48667&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48667&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48667&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48667&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48667&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48667&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48667&r=support Expected behavior: http://bugs.php.net/fix.php?id=48667&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48667&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48667&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48667&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48667&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48667&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48667&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48667&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48667&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48667&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48667&r=mysqlcfg