【发布时间】:2013-07-08 12:01:42
【问题描述】:
是否可以获取已实现接口的方法?
例如,只返回接口中的函数 bar()。
interface iFoo
{
public function bar();
}
class Foo implements iFoo
{
public function bar()
{
...
}
public function fooBar()
{
...
}
}
我知道我可以使用 class_implements 来返回实现的接口,例如
print_r(class_implements('Foo'));
output:
Array ( [iFoo] => iFoo )
如何获取已实现接口的方法?
【问题讨论】: