这段代码报错怎么处理

78次阅读

共计 300 个字符,预计需要花费 1 分钟才能阅读完成。

public function setCodeLength(int $length): GA|PHPGangsta_GoogleAuthenticator
{
$this->_codeLength = $length;
return $this;
}
复制代码
报错内容:
PHP Parse error:syntax error, unexpected ‘|’, expecting ‘;’ or ‘{‘ in /home/wwwroot/www.kskxs.com/src/Utils/GA.php on line 116
复制代码

php7.4.0 以上才支持的用法,需要升级 php 版本

正文完
 0