3v4l.org

run code in 300+ PHP versions simultaneously
<?php $secret_key = sodium_hex2bin( '70637679b45ba313a122e63f12b3a557a01be9c0519fc8d08bb98f3633134e66' . '812540a01852c7e582021d253c1ecee35e948e294befe19ccf1cdbafa6266260' ); $public_key = sodium_hex2bin( '812540a01852c7e582021d253c1ecee35e948e294befe19ccf1cdbafa6266260' ); $message = 'Soatok is a gay/demi dhole furry <3'; $signature = sodium_crypto_sign_detached($message, $secret_key); var_dump(sodium_bin2hex($signature)); var_dump(sodium_crypto_sign_verify_detached($signature, $message, $public_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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
string(128) "ed5ffd42041982926937ea29076431372d05579215f00a77614b63eacf7ab517a7d8040dff9c7958775ede6511655f8a42358afd419b8289607d089df1a3cb02" bool(true)
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 Fatal error: Uncaught Error: Call to undefined function sodium_hex2bin() in /in/lKrJb:2 Stack trace: #0 {main} thrown in /in/lKrJb on line 2
Process exited with code 255.
Output for 7.4.33
Fatal error: Uncaught Error: Call to undefined function sodium_hex2bin() in /in/lKrJb:2 Stack trace: #0 {main} thrown in /in/lKrJb on line 2
Process exited with code 255.
Output for 5.6.0
Fatal error: Call to undefined function sodium_hex2bin() in /in/lKrJb on line 2
Process exited with code 255.

preferences:
168.08 ms | 401 KiB | 192 Q