|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66818 PHP Fatal error: Can't inherit abstract function
Submitted: 2014-03-04 09:37 UTC Modified: 2014-03-04 11:26 UTC
From: oxygenus at gmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: oxygenus at gmail dot com
New email:
PHP Version: OS:


 [2014-03-04 09:37 UTC] oxygenus at gmail dot com
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:
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-04 09:39 UTC] 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 11:26 UTC]
-Status: Open +Status: Not a bug
 [2014-03-04 11:26 UTC]
This appears fixed as of PHP 5.3.9, see Please use current, or at least supported, versions of PHP when reporting bugs.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 18:01:28 2024 UTC