3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Some example variables: $alice_ecdh_secret = "Hallo"; $bob_ecdh_public = "Welt"; $message_keypair = sodium_crypto_box_keypair_from_secretkey_and_publickey( $alice_ecdh_secret, $bob_ecdh_public ); $plaintext = "This is a secret message for your eyes only."; $nonce = random_bytes(24); // And now for the actual public-key encryption step: $ciphertext = sodium_crypto_box($plaintext, $nonce, $message_keypair);
based on nuTAi
Output for 7.2.0 - 7.3.0
Fatal error: Uncaught SodiumException: secretkey should be SODIUM_CRYPTO_BOX_SECRETKEYBYTES bytes in /in/dp2jm:10 Stack trace: #0 /in/dp2jm(10): sodium_crypto_box_keypair_from_secretkey_and_publickey() #1 {main} thrown in /in/dp2jm on line 10
Process exited with code 255.
Output for 7.0.0 - 7.1.25
Fatal error: Uncaught Error: Call to undefined function sodium_crypto_box_keypair_from_secretkey_and_publickey() in /in/dp2jm:8 Stack trace: #0 {main} thrown in /in/dp2jm on line 8
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Call to undefined function sodium_crypto_box_keypair_from_secretkey_and_publickey() in /in/dp2jm:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Call to undefined function sodium_crypto_box_keypair_from_secretkey_and_publickey() in /in/dp2jm:11 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.38
Fatal error: Call to undefined function sodium_crypto_box_keypair_from_secretkey_and_publickey() in /in/dp2jm on line 8
Process exited with code 255.