似乎接口名称实际上是按定义的顺序排列的
- "extends" 优先于 "implements"(即,首先将是来自(实现于)父类的接口(如果有),然后是类本身实现的接口)
- 当多个接口同时/同一级别实现时,它可以是
+ 来自 "implements":它们按定义的顺序排列
+ 来自 "extends"(一个类扩展另一个实现多个接口的类;或一个接口扩展多个接口):它们按相反顺序排列
<?php
interface Foo {}
interface Bar {}
interface Other {}
interface Foobar extends Foo, Bar {}
interface Barfoo extends Bar, Foo {}
class Test1 implements Foo, Bar {}
class Test2 implements Bar, Foo {}
class Test3 extends Test1 {}
class Test4 extends Test2 {}
class Test5 extends Test1 implements Other {}
class Test6 implements Foobar, Other {}
class TestO implements Other {}
class Test7 extends TestO implements Barfoo {}
$r=new ReflectionClass('Test1');
print_r($r->getInterfaceNames()); $r=new ReflectionClass('Test2');
print_r($r->getInterfaceNames()); $r=new ReflectionClass('Test3');
print_r($r->getInterfaceNames()); $r=new ReflectionClass('Test4');
print_r($r->getInterfaceNames()); $r=new ReflectionClass('Test5');
print_r($r->getInterfaceNames()); $r=new ReflectionClass('Test6');
print_r($r->getInterfaceNames()); $r=new ReflectionClass('Test7');
print_r($r->getInterfaceNames()); ?>