Bug #67270 [Opn->Ver]: Interface inferitance conflicting parent method

From: Date: Wed, 23 May 2018 12:40:17 +0000
Subject: Bug #67270 [Opn->Ver]: Interface inferitance conflicting parent method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215341@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67270&edit=1

 ID:                 67270
 Updated by:         cmb@php.net
 Reported by:        eugen dot alter at gmail dot com
 Summary:            Interface inferitance conflicting parent method
-Status:             Open
+Status:             Verified
 Type:               Bug
-Package:            *General Issues
+Package:            Scripting Engine problem
 Operating System:   Any
 PHP Version:        5.5.12
 Block user comment: N
 Private report:     N

 New Comment:

Confirmed: <https://3v4l.org/LRoYH> vs. <https://3v4l.org/EZiqk>.


Previous Comments:
------------------------------------------------------------------------
[2014-05-13 19:57:28] 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.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67270&edit=1


Thread (3 messages)

« previous php.bugs (#215341) next »