Bug #66818 [Opn]: PHP Fatal error: Can't inherit abstract function
| From: | oxygenus at gmail dot com | Date: | Tue, 04 Mar 2014 09:39:32 +0000 |
| Subject: | Bug #66818 [Opn]: PHP Fatal error: Can't inherit abstract function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184511@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66818&edit=1
ID: 66818
User updated by: oxygenus at gmail dot com
Reported by: oxygenus at gmail dot com
Summary: PHP Fatal error: Can't inherit abstract function
Status: Open
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Note weird behaviour (not reproduced by provided script): the parser complains about InheritBase not
beeing able to inherit "inheritMe()" from InheritBase.
In short, it appears to be attempting to inherit from itself.
Previous Comments:
------------------------------------------------------------------------
[2014-03-04 09:37:08] oxygenus at gmail dot com
Description:
------------
Works on Windows 8 x64 with PHP 5.3.1 and PHP 5.5.9.
Fails on Linux with PHP 5.3.1 and 5.3.3. I do not have a Linux available with a newer PHP version.
Test script:
---------------
<?php
interface iInherit
{
public function inheritMe();
}
abstract class InheritBase implements iInherit
{
abstract public function inheritMe();
}
class Child extends InheritBase
{
public function inheritMe()
{
}
}
Expected result:
----------------
Expecting a successfull compilation.
Actual result:
--------------
PHP Fatal error: Can't inherit abstract function iInherit::inheritMe() (previously declared
abstract in InheritBase) in test.php on line 8
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66818&edit=1