我尝试实现TOTP PHP库作为登录表单的另一种身份验证。我从github下载了以下代码并按照安装说明进行安装:
<?php
include('src/Factory.php');
include('src/HOTP.php');
include('src/HOTPInterface.php');
include('src/OTP.php');
include('src/OTPInterface.php');
include('src/ParameterTrait.php');
include('src/TOTP.php');
include('src/TOTPInterface.php');
use OTPHP\TOTP;
$otp = TOTP::create();
echo 'The current OTP is: '.$otp->now();
?>然而,我最终得到了错误消息Warning: Unsupported declare 'strict_types' in C:\wamp64\www\otp\src\HOTP.php on line 3和Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in C:\wamp64\www\otp\src\HOTP.php on line 28。
我不明白为什么会这样。非常感谢你的帮助。谢谢。
https://stackoverflow.com/questions/44334745
复制相似问题