Bug #68438 [Opn->Dup]: Can not inherit abstract function to extend its syntax
| From: | nikic@php.net | Date: | Sat, 16 Apr 2016 13:41:03 +0000 |
| Subject: | Bug #68438 [Opn->Dup]: Can not inherit abstract function to extend its syntax | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200592@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68438&edit=1
ID: 68438
Updated by: nikic@php.net
Reported by: someone dot wanted dot to dot be dot unknown at
gmail dot com
Summary: Can not inherit abstract function to extend its
syntax
-Status: Open
+Status: Duplicate
Type: Bug
Package: Reproducible crash
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
This will certainly not be allowed, as it violates LSP. I'm closing this as a duplicate of bug
#63384 to track the unhelpful error message (it should be complaining about the signature mismatch
instead).
Previous Comments:
------------------------------------------------------------------------
[2014-11-17 19:08:27] someone dot wanted dot to dot be dot unknown at gmail dot com
I saw previously reported bugs, but this is NOT about inheriting method in interfaces, but in
classes. It is not fix for now.
http://3v4l.org/rj5AF
------------------------------------------------------------------------
[2014-11-17 19:06:52] someone dot wanted dot to dot be dot unknown at gmail dot com
Description:
------------
My code class A, that defined abstract method
method with one argument.
After that class B extends A. In this place I can not extend signature of method (for
example, add new required arguments).
Code is following.
That's strange and non-intuitive behavior.
This bug is appearing on PHP 5.0.0 - 5.6.3.
Test script:
---------------
abstract class A {
abstract function method($a);
}
abstract class B extends A {
abstract function method($a, $b);
}
Expected result:
----------------
none printable result
Actual result:
--------------
Fatal error: Can't inherit abstract function A::method() (previously declared abstract in B) in
...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68438&edit=1