<?php
//インターフェース
interface TestInterface {
//コンスト
const STR_CONST = "AAA";
//methodA
public function methodA();
//methodA
public function methodB($str);
}
//インターフェースを実装したクラス
class Test implements TestInterface {
//methodAを実装
public function methodA() {
return self::STR_CONST;
}
//methodBを実装
public function methodB($str) {
print $str;
}
}
//Testクラス生成
$test = new Test();
//methodA
print $test->methodA();
//methodB
$test->methodB("BBB");
?>
|