嘟嘟社区

[疑问] 这段代码报错怎么处理


  1. public function setCodeLength(int $length): GA|PHPGangsta_GoogleAuthenticator
  2.     {
  3.         $this->_codeLength = $length;
  4. return $this;
  5.     }

复制代码

报错内容:

  1. 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版本