(PECL)
注意: 本函数不能用于操作当前正在运行(或运行链上)的方法。
本函数是实验性的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 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!