From:             kotlyar dot maksim at gmail dot com
Operating system: linux
PHP version:      5.4.10
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:implementation child interface and after parent cause fatal 
error.

Description:
------------
Order of implemented interfaces should make any difference. But it is not
the 
case. If I implement child interface and parent after I will get a fatal
error


Test script:
---------------
<?php
ini_set('display_errors', 1);
error_reporting(-1);


interface RootInterface
{
    function foo();
}

interface FirstChildInterface extends RootInterface
{
    function foo();
}

interface SecondChildInterface extends RootInterface
{
    function foo();
}

//works fine.
class A implements FirstChildInterface, SecondChildInterface
{
    function foo()
    {
    }
}

//also ok.
class B implements RootInterface, FirstChildInterface
{
    function foo()
    {
    }
}

//there is a fatal error.
class C implements FirstChildInterface, RootInterface 
{
    function foo()
    {
    }
}

Expected result:
----------------
Should work without errors(as previous examples).

Actual result:
--------------
PHP Fatal error:  Class C cannot implement previously implemented interface

RootInterface in /foo/test.php on line 35
PHP Stack trace:
PHP   1. {main}() /foo/test.php:0

Fatal error: Class C cannot implement previously implemented interface 
RootInterface in /foo/test.php on line 35

Call Stack:
    0.0008     238784   1. {main}() /foo/test.php:0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63816&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63816&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63816&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63816&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63816&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63816&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63816&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63816&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63816&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63816&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63816&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63816&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63816&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63816&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63816&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63816&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63816&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63816&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63816&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63816&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63816&r=mysqlcfg

Reply via email to