ID:               34019
 Updated by:       [EMAIL PROTECTED]
 Reported By:      stochnagara at hotmail dot com
 Status:           Assigned
 Bug Type:         Class/Object related
 Operating System: *
 PHP Version:      5CVS-2005-08-07
 Assigned To:      helly
 New Comment:

Fixed in head now


Previous Comments:
------------------------------------------------------------------------

[2005-08-06 23:39:27] [EMAIL PROTECTED]

I think we should either disable __construct/__destruct enforcement or
ensure the interface rules apply since that is imho the only thing that
would make sense.

------------------------------------------------------------------------

[2005-08-06 14:09:09] stochnagara at hotmail dot com

Description:
------------
When a class implements an interface which declares a funciton
__construct with a given prototype and the class does not follow this
prototype, then PHP does not raise a fatal error like in all other
cases.

I know that __construct has a lot of special features but I think we
need at least a notice for that.

Reproduce code:
---------------
interface constr {
        function __construct();
}

class implem implements constr {
        function __construct ($a) {
        }
}


Expected result:
----------------
Fatal error:  Declaration of implem::__construct() must be compatible
with that of constr::__construct() in ...

Actual result:
--------------
5


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34019&edit=1

Reply via email to