下面的PHP函数产生了这个错误:解析错误:语法错误,意外',',在此行上代码:( $className, new $this->registerService( $service ) );
有谁知道什么是错的?
function lazyCreateSingletonServiceByClassName($className) {
$service = $this->createContextAwareObjectOfClass( $className );
if (method_exists( $service, 'init' )) {
$service->init( );
}
SingletonServiceProvider;
( $className, new $this->registerService( $service ) );
}
罐
答案 0 :(得分:5)
我无法确切知道这里发生了什么,但我认为
SingletonServiceProvider;
( $className, new $this->registerService( $service ) );
应该是
SingletonServiceProvider( $className, new $this->registerService( $service ) );