Bug #67777 [Opn]: Method overriding and derived classes
| From: | jpauli@php.net | Date: | Thu, 27 Nov 2014 10:44:53 +0000 |
| Subject: | Bug #67777 [Opn]: Method overriding and derived classes | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-574@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67777&edit=1
ID: 67777
Updated by: jpauli@php.net
Reported by: joelm@php.net
Summary: Method overriding and derived classes
Status: Open
Type: Bug
Package: PHP Language Specification
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Is this a PHP bug ?
Previous Comments:
------------------------------------------------------------------------
[2014-08-05 17:01:00] joelm@php.net
Description:
------------
https://github.com/php/php-langspec/blob/master/spec/14-classes.md#general
"Methods and properties from a base class can be overridden in a derived class by redeclaring
them with the same signature defined in the base class." This is not accurate. When a derived
class overrides a method, if there is no abstract decl (either abstract decl in an abstract parent
or a decl in an implemented interface) in the inheritance hierarchy then whatever signature you want
can be used for the derived method. If there is an abstract decl in the inheritance hierarchy, then
the derived method's signature must match the signature of the abstract decl.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67777&edit=1