runkit_class_adopt
runkit_class_adopt — ある基底クラスを、他のクラスを継承させたクラスに変換する。親クラスの適切なメソッドを追加する
説明
bool runkit_class_adopt ( string classname, string parentname )パラメータ
- classname
-
変換の対象となるクラス。
- parentname
-
継承させる親クラス。
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。例
例 1946. runkit_class_adopt() の例
<?php
class myParent {
function parentFunc() {
echo "Parent Function Output\n";
}
}
class myChild {
}
runkit_class_adopt('myChild','myParent');
myChild::parentFunc();
?>
上の例の出力は以下となります。Parent Function Output
参考
runkit_class_emancipate() |
Weblioに収録されているすべての辞書からrunkit_class_adoptを検索する場合は、下記のリンクをクリックしてください。

- runkit_class_adoptのページへのリンク