|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
40 - 8 = ?
Subscribe to this entry?

 [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-2022 The PHP Group
All rights reserved.
Last updated: Fri Jul 01 01:03:36 2022 UTC