【发布时间】:2014-09-13 15:18:20
【问题描述】:
我有这个代码:
<?PHP
function call_and_set( $obj, $txt){
return call_user_method('example', $obj, $txt);
}
class test{
function example($text){
echo $text;
}
}
$test = new test();
call_and_set($test, "Hello World!");
?>
在我的代码中我并不总是想使用
$test = 新测试 ....
我想直接使用名称而不是$test。例如:
call_and_set("test", "Hellow World!").
【问题讨论】: