Bug #75202 [NEW]: Interfaces shouldn't be able to define a constructor

From: Date: Wed, 13 Sep 2017 09:34:43 +0000
Subject: Bug #75202 [NEW]: Interfaces shouldn't be able to define a constructor
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211118@lists.php.net to get a copy of this message
From: kelunik Operating system: PHP version: Irrelevant Package: Scripting Engine problem Bug Type: Bug Bug description:Interfaces shouldn't be able to define a constructor 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 bug report at https://bugs.php.net/bug.php?id=75202&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75202&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75202&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75202&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75202&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75202&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75202&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75202&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75202&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75202&r=support Expected behavior: https://bugs.php.net/fix.php?id=75202&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75202&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75202&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75202&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75202&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75202&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75202&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75202&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75202&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75202&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75202&r=mysqlcfg

« previous php.bugs (#211118) next »