Edit report at https://bugs.php.net/bug.php?id=64235&edit=1
ID: 64235 Updated by: [email protected] Reported by: imenem at inox dot ru Summary: Insteadof not work for class method in 5.4.11 -Status: Assigned +Status: Feedback Type: Bug Package: Scripting Engine problem Operating System: Debian GNU/Linux PHP Version: 5.4.11 Assigned To: dmitry Block user comment: N Private report: N New Comment: Yet another traits mess :( I suppose, it worked in 5.4.4 because of mistake. RFC and traits documentation don't say if class names may be used in context of "as" and "insteadof" operators. In my opinion, class names must not be used in contest of "as". However, their usage in context of "inseadof" may make sense (I'm not sure). Anyway, it has to be defined in documentation first. Previous Comments: ------------------------------------------------------------------------ [2013-02-20 07:44:12] [email protected] fix attached, which fix this bug, and trigger fatal error in compile time for the test script I pasted before. ------------------------------------------------------------------------ [2013-02-20 07:41:23] [email protected] The following patch has been added/updated: Patch Name: bug64235.phpt Revision: 1361346083 URL: https://bugs.php.net/patch-display.php?bug=64235&patch=bug64235.phpt&revision=1361346083 ------------------------------------------------------------------------ [2013-02-20 07:39:40] [email protected] The following patch has been added/updated: Patch Name: bug64235.patch Revision: 1361345980 URL: https://bugs.php.net/patch-display.php?bug=64235&patch=bug64235.patch&revision=1361345980 ------------------------------------------------------------------------ [2013-02-20 07:15:37] [email protected] actually, I was looking into this, I have thought the similar fix of you, but unfortunatly, it is wrong, thinking of this: <?php class TestParentClass { public function method() { print_r('Parent method'); print "\n"; } } trait TestTrait { public function method() { print_r('Trait method'); print "\n"; } } class TestChildClass extends TestParentClass { use TestTrait { TestParentClass::method as methodParent; } } (new TestChildClass)->methodParent(); ~ ------------------------------------------------------------------------ [2013-02-20 07:00:53] [email protected] Hi dmitry, will you take a look please. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64235 -- Edit this bug report at https://bugs.php.net/bug.php?id=64235&edit=1
