Bug #69911 [NEW]: Interface apply to trait

From: Date: Tue, 23 Jun 2015 11:14:49 +0000
Subject: Bug #69911 [NEW]: Interface apply to trait
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193794@lists.php.net to get a copy of this message
From: igor at glagola dot ru Operating system: Linux PHP version: 5.6.10 Package: Compile Failure Bug Type: Bug Bug description:Interface apply to trait Description: ------------ Hi, I've got strange name collision, interface applies to trait's method before trait's method rename statement. Test script: --------------- <?php interface SomeInterface { public function theAction(); } trait TheTrait { public function theAction($param) { } } class CC { public function theAction() { } } class BB extends CC implements SomeInterface { use TheTrait { TheTrait::theAction as otherAction; } } Expected result: ---------------- I expect no errors Actual result: -------------- PHP Fatal error: Declaration of TheTrait::theAction() must be compatible with SomeInterface::theAction() in /tmp/a.php on line 22 PHP Stack trace: PHP 1. {main}() /tmp/a.php:0 -- Edit bug report at https://bugs.php.net/bug.php?id=69911&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69911&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69911&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69911&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69911&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69911&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69911&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69911&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69911&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69911&r=support Expected behavior: https://bugs.php.net/fix.php?id=69911&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69911&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69911&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69911&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69911&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69911&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69911&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69911&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69911&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69911&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69911&r=mysqlcfg

« previous php.bugs (#193794) next »