【发布时间】:2017-05-28 12:43:29
【问题描述】:
public static function someStaticMethod($method, ...$args)
{
...
return self::{"_$method"}(...$args);
}
因此,尽管代码对 PHP 7 有效,并且在 Languages & Frameworks | PHP 设置中语言级别设置为 7.1,但我收到返回行的错误提示。
能否以某种方式禁用这条线或这种情况,或者我真的把事情搞砸了?
PhpStorm 版本:2016.2.2
第一个花括号上显示的错误提示:
预期:命名空间或使用或 goto 或 if 或 elseif 或 else 或 for 或 foreach 关键字或 while 或 do 或 switch 或 case 或 default 关键字或 try 或 catch 或 declare 或 break 或 endif 或 endfor 或 endforeach 或 endwhile 或 endswitch 或 enddeclare 或 die 或 exit 或 private 或 function 或 new 或 instanceof 或 const 或 list 或 implements 或 eval or final or as or throw or include_once or class or abstract or interface 关键字或 public 关键字或 static 关键字或 clone 关键字 或 isset 关键字或空关键字或 return 或 var 或 continue 或 protected 或 print 或 echo 或 include 或 global 或 extends 或 unset 或 require_once or array or callable or require or identifier or and 关键字或或关键字或异或关键字或特征或代替或最终 或产量
【问题讨论】: