classkit_import

(PECL)

classkit_import -- Import new class method definitions from a file

説明

array classkit_import ( string filename )

注意: この関数により現在実行中(もしくはチェーンド)のメソッドを操作することはできません。

警告

この関数は、 実験的なステータスにあります。これは、この関数の 動作、関数名、ここで書かれていること全てがPHPの将来のバージョンで予告 なく変更される可能性があることを意味します。注意を喚起するとともに自分 のリスクでこの関数を使用してください。

パラメータ

filename

The filename of the class method definitions to import

戻り値

Associative array of imported methods

例 1. classkit_import() example

<?php
// file: newclass.php
class Example {
    function
foo() {
        return
"bar!\n";
    }
}
?>
<?php
// requires newclass.php (see above)
class Example {
    function
foo() {
        return
"foo!\n";
    }
}

$e = new Example();

// output original
echo $e->foo();

// import replacement method
classkit_import('newclass.php');

// output imported
echo $e->foo();

?>

上の例の出力は以下となります:

foo!
bar!

以下も参照ください

classkit_method_add()
classkit_method_copy()