Bug #75202 [Opn]: Interfaces shouldn't be able to define a constructor
| From: | cmb@php.net | Date: | Wed, 13 Sep 2017 13:45:58 +0000 |
| Subject: | Bug #75202 [Opn]: Interfaces shouldn't be able to define a constructor | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211129@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75202&edit=1
ID: 75202
Updated by: cmb@php.net
Reported by: kelunik@php.net
Summary: Interfaces shouldn't be able to define a constructor
Status: Open
Type: Bug
Package: Class/Object related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I think this issue should be discussed in internals, Niklas.
Previous Comments:
------------------------------------------------------------------------
[2017-09-13 09:34:40] kelunik@php.net
Description:
------------
Interfaces shouldn't be able to enforce a signature for
__construct. Parent
classes can't enforce that either, for classes there's no compatibility check, but
interfaces have them.
See https://3v4l.org/mSPL5 vs. https://3v4l.org/RYdFG
This is related to #50302 which I believe is a bug, even if it has been closed as not being one.
In case it's decided that this is not a bug, this bug can serve as documentation of it not
being a bug.
Expected result:
----------------
Probably a compile time error, that the interface defines __construct.
Actual result:
--------------
The interface is defined with __construct and the signature enforced in classes implementing it.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75202&edit=1