|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-01-08 13:37 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2020-01-08 13:37 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 13:00:01 2025 UTC |
Description: ------------ An abstract static method can be overridden by a non-static method in a child class if it originates from a trait. Usually this would generate a compile error. Test script: --------------- <?php trait T { public function foo() {} } abstract class A { abstract static function foo(); } class B extends A { // This throws an error: // Cannot make static method A::foo() non static in class B //public function foo() {} // This doesn't: use T; } Expected result: ---------------- Fatal error: Cannot make static method A::foo() non static in class B Actual result: -------------- Nothing