|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-16 13:39 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2016-04-16 13:39 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
Description: ------------ When extending abstract classes you are not allowed to change an abstract method's signature to a compatible one. This works perfectly fine for concrete classes though. Test script: --------------- //This code works: class A { public function a () {} } class B extends A { public function a ($t = false) {} } //this code throws an error: abstract class A { abstract public function a (); } abstract class B extends A { abstract public function a ($t = false); } Expected result: ---------------- Extending an abstract method should behaves consistently with extending concrete methods Actual result: -------------- Fatal error: Can't inherit abstract function A::a() (previously declared abstract in B)