<?php
use \Firebase\JWT\JWT;
//function to generate JWT
function generateJWT () {
$key = 'key';
$secret = 'secret';
$token = array(
"iss" => $key,
// The benefit of JWT is expiry tokens, we'll set this one to expire in 1 minute
"exp" => time() + 60
);
return JWT::encode($token, $secret);
}
echo generateJWT();
Fatal error: Uncaught Error: Class 'Firebase\JWT\JWT' not found in /in/g2f77:14
Stack trace:
#0 /in/g2f77(17): generateJWT()
#1 {main}
thrown in /in/g2f77 on line 14
Process exited with code 255.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/g2f77 on line 3
Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /in/g2f77 on line 3
Process exited with code 255.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/g2f77 on line 3
Parse error: parse error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in /in/g2f77 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/g2f77 on line 3
Parse error: parse error, expecting `T_CONSTANT_ENCAPSED_STRING' or `'('' in /in/g2f77 on line 3
Process exited with code 255.