|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-08-15 11:16 UTC] gron@php.net
[2011-08-15 11:18 UTC] gron@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: gron
[2011-08-15 11:18 UTC] gron@php.net
[2012-04-18 09:49 UTC] laruence@php.net
[2012-07-24 23:40 UTC] rasmus@php.net
[2013-11-17 09:36 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
Description: ------------ When resolving trait abstract methods, it seems the class hierarchy is not checked, resulting in a fatal error if an abstract method isn't implemented directly in the class that is utilising the trait. Test script: --------------- <?php trait ATrait { function bar() { $this->foo(); } abstract function foo(); } class Base { function foo() { } } class Child extends Base { use ATrait; } Actual result: -------------- PHP Fatal error: Cannot make non abstract method Base::foo() abstract in class Child in /home/jared/Temp/trait.php on line 21 Fatal error: Cannot make non abstract method Base::foo() abstract in class Child in /home/jared/Temp/trait.php on line 21