#35057 [Opn->Bgs]: abstract method inheritance and interface implementation problem
| From: | helly@php.net | Date: | Tue, 01 Nov 2005 20:53:47 +0000 |
| Subject: | #35057 [Opn->Bgs]: abstract method inheritance and interface implementation problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-87363@lists.php.net to get a copy of this message | ||
ID: 35057
Updated by: helly@php.net
Reported By: antonsub at pochtamt dot ru
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.1.0RC4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
B::foo is not A::foo, so when C inherits B it gets B::foo and when it
implements A it gets A:foo, obviously A::foo and B::foo are different.
That's what the error tells you.
Previous Comments:
------------------------------------------------------------------------
[2005-11-01 21:12:39] antonsub at pochtamt dot ru
Description:
------------
Code given produces fatal error:
Can't inherit abstract function A::foo() (previously declared abstract
in B) in foo.php on line 20
Reproduce code:
---------------
<?php
interface A
{
public function foo($id);
}
abstract class B
{
abstract public function foo($id);
}
class C extends B
{
public function foo($id)
{
echo "foo\n";
}
}
class D extends C implements A {}
var_dump(new D);
?>
Expected result:
----------------
But is expected to run cleanly.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35057&edit=1