3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for 7.0.0 - 7.0.30, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
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.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30
Fatal error: Class 'Firebase\JWT\JWT' not found in /in/g2f77 on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
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.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
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.

preferences:
176.12 ms | 401 KiB | 268 Q