php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67270 Interface inferitance conflicting parent method
Submitted: 2014-05-13 19:57 UTC Modified: 2021-06-30 14:27 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: eugen dot alter at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: Scripting Engine problem
PHP Version: 5.5.12 OS: Any
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 !
Your email address:
MUST BE VALID
Solve the problem:
24 - 2 = ?
Subscribe to this entry?

 
 [2014-05-13 19:57 UTC] eugen dot alter at gmail dot com
Description:
------------
PHP does not restrict extension of two interfaces that have conflicting methods if extension is made right-to-left.


Test script:
---------------
interface Foo
{
   public function test(array $x, $y=0);
}

interface Bar
{
   public function test(array $x, $y);
}

interface Baz extends Foo, Bar {}

//however, this will fail with expected fatal error:
//interface Baz extends Bar, Foo {}


Expected result:
----------------
Fatal error: Declaration of Bar::test() must be compatible with

Actual result:
--------------
All goes well. No error happened.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-23 12:40 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: *General Issues +Package: Scripting Engine problem
 [2018-05-23 12:40 UTC] cmb@php.net
Confirmed: <https://3v4l.org/LRoYH> vs. <https://3v4l.org/EZiqk>.
 [2021-06-30 14:27 UTC] cmb@php.net
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-06-30 14:27 UTC] cmb@php.net
I'm closing this as duplicate of bug #76361.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Aug 02 01:01:24 2021 UTC