From: Operating system: Any PHP version: 5.4.0beta2 Package: Scripting Engine problem Bug Type: Bug Bug description:interface + use trait yields error for the abstract class?
Description: ------------ The code in the test script contains one trait and an interface, that uses this trait ("use TestTrait"). What I was trying to do here is to see how PHP behaves if i include "use" statement inside interface definition. Suprisingly, test script produces very interesting result - I get a fatal error with the following text: "Class TestInterface contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (TestInterface::b)". It looks like PHP's compiler messes up when I mix interfaces together with "use" statement and somehow treats "TestInterface" as an abstract class. I didn't go deeper to look into the problem as it's pretty clear that something is wrong here. In my opinion, PHP should not allow usage of "use" statment inside interface defitions. Test script: --------------- trait TestTrait { } interface TestInterface { use TestTrait; public function b(); } Expected result: ---------------- PHP Fatal error: use of "use" statement in interfaces is not allowed. Actual result: -------------- PHP Fatal error: Class TestInterface contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (TestInterface::b). -- Edit bug report at https://bugs.php.net/bug.php?id=60145&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60145&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60145&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60145&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60145&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60145&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60145&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60145&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60145&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60145&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60145&r=support Expected behavior: https://bugs.php.net/fix.php?id=60145&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60145&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60145&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60145&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60145&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60145&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60145&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60145&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60145&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60145&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60145&r=mysqlcfg