我从你的评论中得出的结论是pethouseuk-functionality.php
include \'AlterTableComments.php\';
use PethouseukFunctionality\\AlterTable;
$a = \'PethouseukFunctionality\\AlterTable\\test\';
$a(); // function call
$b = \'PethouseukFunctionality\\AlterTable\\AlterTableComments\';
$c = new $b; // new object
$c->yourfunction(\'test\'); // Method call
另一个文件AlterTableComments。php
<?php
namespace PethouseukFunctionality\\AlterTable;
interface AlterTableInterface{
function yourfunction($param);
}
class AlterTableComments implements AlterTableInterface{
function yourfunction($param){
var_dump($param);
}
}
function test(){
echo \'this is test \';
}
Result: 这是测试字符串(4)“测试”