3v4l.org

run code in 300+ PHP versions simultaneously
<?php # require 'vendor/autoload.php'; use \Firebase\JWT\JWT; use \Firebase\JWT\Key; // デコードするJWT $jwt = "aaaaaa"; // 秘密鍵 $secretKey = "beniya"; try { // JWTのデコード $decoded = JWT::decode($jwt, new Key($secretKey, 'HS256')); print_r($decoded); } catch (Exception $e) { // エラーハンドリング echo 'Error: ' . $e->getMessage(); }
Output for 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.2
Fatal error: Uncaught Error: Class "Firebase\JWT\JWT" not found in /in/2EVTV:16 Stack trace: #0 {main} thrown in /in/2EVTV on line 16
Process exited with code 255.

preferences:
41.66 ms | 406 KiB | 5 Q