PHP 的 use function 提示方法不能存在
controller.php
namespace App\Http\Controllers;
use function App\Http\Controllers\helper;
class WelcomeController
{
public function test() {
helper();
}
}
function.php
namespace App\Http\Controllers;
function helper()
{
return 1;
}
报错Call to undefined function AppHttpControllershelper()
添加回答
举报
0/150
提交
取消