3v4l.org

run code in 300+ PHP versions simultaneously
<?php $packed = '{"nonce":"xobK27GhMR960tSTcg5nrFSy35uwkKYn","key":"px2BaIAx17vdBQFdnLBimERK6KHqHNxhJN0PzKfhMHE","secretbox":"RFgczAJ_L0hOpIb_O0k9dFE58Cz-dagdEA3aHxUq_Q6jCEzTdzlMQyI7jEoauWOlH7m3EEXv4OFiD-Ke3otsoLJV0TPFbV2HV59pGNsSux9e"}'; $decoded = json_decode($packed, true); function base64url_decode(string $str): string { return base64_decode(strtr($str, '-_', '+/')); } $nonce = base64url_decode($decoded['nonce']); $key = base64url_decode($decoded['key']); $secretbox = base64url_decode($decoded['secretbox']); var_dump(sodium_crypto_secretbox_open($secretbox, $nonce, $key));
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.32, 8.0.0 - 8.0.30, 8.1.0 - 8.1.22, 8.2.0 - 8.2.9
string(65) "don't mind me, just a feline getting comfy in this secretbox 🐱"
Output for 7.4.33
Fatal error: Uncaught Error: Call to undefined function sodium_crypto_secretbox_open() in /in/OODYk:14 Stack trace: #0 {main} thrown in /in/OODYk on line 14
Process exited with code 255.

preferences:
103.12 ms | 419 KiB | 19 Q