|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 12:01:26 2024 UTC