我可以使用以下代码来工作吗:
new \Controllers\ServiceController()->fbdump();
是的,但是你需要添加一组括号,因为->优先级高于new:
->
new
(new \Controllers\ServiceController)->fbdump();
new ( \Controllers\ServiceController->fbdump() );
new ( \Controllers\ServiceController->fbdump() );
这将无法正常工作。 - Paul