From:             baldurien at bbnwn dot eu
Operating system: Irrelevant
PHP version:      5.2.0
PHP Bug Type:     Feature/Change Request
Bug description:  A class can't implements interface implemented by implemented 
interface/classes

Description:
------------
Hi,

Since php5.2, all my classes have error due to something that changed in
php5.2 : 

Fatal error: Class XtfLexer cannot implement previously implemented
interface XtfParserRegistrable 

The reason of that ?

Well take a look at the classes (the code does not interest you as it's
not the problem)

interface XtfParserRegistrable {}
interface XtfHeaderHandler extends XtfParserRegistrable {}
class XtfLexer implements XtfHeaderHandler, XtfParserRegistrable {}

Because the interface extends XtfParserRegistrable, the XtfLexer can not
implements XtfParserRegistrable itself.

This is STUPID, REALLY STUPID.

What happens if one day I change the interface/classes I
implements/extends, and if I still wish to benefit from one interface that
is *possibly* implemented by my parents interfaces/classes?

Well : it will fails.

Reproduce code:
---------------
Try this :

interface XtfParserRegistrable {}
interface XtfHeaderHandler extends XtfParserRegistrable {}
class XtfLexer implements XtfHeaderHandler, XtfParserRegistrable {}


Expected result:
----------------
We can implements interface implemented by parent class/interface, and no
(fatal) error should be thrown.

Actual result:
--------------
We can't.

-- 
Edit bug report at http://bugs.php.net/?id=39403&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39403&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39403&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39403&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39403&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39403&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39403&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39403&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39403&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39403&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39403&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39403&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39403&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39403&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39403&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39403&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39403&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39403&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39403&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39403&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39403&r=mysqlcfg

Reply via email to