3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(extension_loaded('sodium')) { echo "libsodium is present.\n"; } printf("Opcache is %s.\n", ini_get('opcache.enable')); $super_important_data = 'The quick brown fox jumps over the lazy dog\'s back.'; $private_key = 'zB4nMZZjjEUZPsCDo5YgoFiYsXFHpdfImGiybqT6MwgshCDnt/IVzQ19vY1X9l2GyP/V1NcYQf2XlLjYrTtEZg=='; $public_key = 'LIQg57fyFc0Nfb2NV/Zdhsj/1dTXGEH9l5S42K07RGY='; $super_important_signature = sodium_crypto_sign_detached($super_important_data, $private_key);
Output for 8.0.1 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
libsodium is present. Opcache is 1. Fatal error: Uncaught SodiumException: sodium_crypto_sign_detached(): Argument #2 ($secret_key) must be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes long in /in/p1UVL:13 Stack trace: #0 /in/p1UVL(13): sodium_crypto_sign_detached() #1 {main} thrown in /in/p1UVL on line 13
Process exited with code 255.
Output for 8.0.13
libsodium is present. Opcache is . Fatal error: Uncaught SodiumException: sodium_crypto_sign_detached(): Argument #2 ($secret_key) must be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes long in /in/p1UVL:13 Stack trace: #0 /in/p1UVL(13): sodium_crypto_sign_detached() #1 {main} thrown in /in/p1UVL on line 13
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 8.0.0
Opcache is 1. Fatal error: Uncaught Error: Call to undefined function sodium_crypto_sign_detached() in /in/p1UVL:13 Stack trace: #0 {main} thrown in /in/p1UVL on line 13
Process exited with code 255.
Output for 7.4.33
Opcache is . Fatal error: Uncaught Error: Call to undefined function sodium_crypto_sign_detached() in /in/p1UVL:13 Stack trace: #0 {main} thrown in /in/p1UVL on line 13
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
libsodium is present. Opcache is 1. Fatal error: Uncaught SodiumException: secret key size should be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes in /in/p1UVL:13 Stack trace: #0 /in/p1UVL(13): sodium_crypto_sign_detached() #1 {main} thrown in /in/p1UVL on line 13
Process exited with code 255.
Output for 7.3.32 - 7.3.33
libsodium is present. Opcache is . Fatal error: Uncaught SodiumException: secret key size should be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes in /in/p1UVL:13 Stack trace: #0 /in/p1UVL(13): sodium_crypto_sign_detached() #1 {main} thrown in /in/p1UVL on line 13
Process exited with code 255.

preferences:
181.87 ms | 401 KiB | 212 Q