(PHP 5, PHP 7, PHP 8)
ReflectionClass::getInterfaces — 取得介面
此函式沒有參數。
一個關聯式 陣列,鍵為介面名稱,陣列值為 ReflectionClass 物件。
範例 #1 ReflectionClass::getInterfaces() 範例
<?php
interface Foo { }
interface Bar { }
class Baz implements Foo, Bar { }
$rc1 = new ReflectionClass("Baz");
print_r($rc1->getInterfaces());
?>上述範例將輸出類似以下的內容
Array
(
[Foo] => ReflectionClass Object
(
[name] => Foo
)
[Bar] => ReflectionClass Object
(
[name] => Bar
)
)