|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72034 abstract classes' method compatibility is checked the other way round
Submitted: 2016-04-15 17:42 UTC Modified: 2016-04-16 07:22 UTC
From: youwishspambot at example dot org Assigned:
Status: Verified Package: Scripting Engine problem
PHP Version: 7.0.5 OS:
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: youwishspambot at example dot org
New email:
PHP Version: OS:


 [2016-04-15 17:42 UTC] youwishspambot at example dot org

and it's a problem for optional parameters:

Test script:
interface AAA{
    function method($x);

interface BBB extends AAA{
    function method($x, $y = null);

// this works correctly:
class AA_ implements AAA{
    function method($x){}
class BB_ extends AA_ implements BBB{
    function method($x, $y = null){}
(new BB_())->method(1, 1);

// this doesn't:
abstract class AAA_ implements AAA{}
abstract class BBB_ extends AAA_ implements BBB{}
// AAA::method is checked to be compatible against BBB::method,
// while it should happen the opposite


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-16 07:22 UTC]
-Status: Open +Status: Verified
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC