3v4l.org

run code in 300+ PHP versions simultaneously
<?php const NL = PHP_EOL; $json = rtrim('{ "access_token": "ya29.Il-4B7Tpewa", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "1//09ghRt", "scope": "https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.activity.read" } 1', ' 1'); $jsonObj = json_decode($json); echo $jsonObj->access_token; echo NL; echo $jsonObj->refresh_token; echo NL; echo $jsonObj->expires_in; echo NL; $jsonArr = json_decode($json, true); echo $jsonArr['access_token']; echo NL; echo $jsonArr['refresh_token']; echo NL; echo $jsonArr['expires_in'];
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
ya29.Il-4B7Tpewa 1//09ghRt 3600 ya29.Il-4B7Tpewa 1//09ghRt 3600
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 ya29.Il-4B7Tpewa 1//09ghRt 3600 ya29.Il-4B7Tpewa 1//09ghRt 3600

preferences:
151.29 ms | 402 KiB | 177 Q