Bug #66818 [Opn->Nab]: PHP Fatal error: Can't inherit abstract function
Edit report at https://bugs.php.net/bug.php?id=66818&edit=1
ID: 66818
Updated by: nikic@php.net
Reported by: oxygenus at gmail dot com
Summary: PHP Fatal error: Can't inherit abstract function
-Status: Open
+Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
This appears fixed as of PHP 5.3.9, see http://3v4l.org/NP9Be.
Please use current, or at least supported, versions of PHP when reporting bugs.
Previous Comments:
------------------------------------------------------------------------
[2014-03-04 09:39:32] oxygenus at gmail dot com
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.
------------------------------------------------------------------------
[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
Thread (3 messages)