|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-23 11:33 UTC] david at grudl dot com
[2011-03-23 00:11 UTC] clicky at erebot dot net
[2011-12-04 09:40 UTC] clicky at erebot dot net
[2015-04-07 16:59 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
[2015-04-07 16:59 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 23 11:00:02 2025 UTC |
Description: ------------ I think this fatal error is needless. Interface implementors can append optional parameter: interface IAnimal { function speak(); } class Dog implements IAnimal { function speak($optional = NULL) { echo 'Bark!'; } } class Labrador extends Dog { function speak($optional = NULL, $anotherOptinal = NULL) { ... } } That's correct behaviour. But the same behaviour is unallowed for interface extenders. Reproduce code: --------------- interface IAnimal { function speak(); } interface IHuman extends IAnimal { function speak($language = NULL); } Expected result: ---------------- no error Actual result: -------------- Fatal error: Can't inherit abstract function IAnimal::speak() (previously declared abstract in IHuman)