3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Some example variables: $alice_ecdh_secret = "\x69\xf2\x08\x41\x2d\x8d\xd5\xdb\x9d\x0c\x6d\x18\x51\x2e\x86\xf0" . "\xec\x75\x66\x5a\xb8\x41\x37\x2d\x57\xb0\x42\xb2\x7e\xf8\x9d\x8c"; $bob_ecdh_public = "\xe8\x98\x0c\x86\xe0\x32\xf1\xeb\x29\x75\x05\x2e\x8d\x65\xbd\xdd" . "\x15\xc3\xb5\x96\x41\x17\x4e\xc9\x67\x8a\x53\x78\x9d\x92\xc7\x54"; $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);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.20.0120.01119.82
7.2.10.0080.01019.82
7.2.00.0100.01419.61
7.1.140.0100.01218.30
7.1.130.0070.01118.69
7.1.120.0120.01018.69
7.1.110.0090.01318.25
7.1.100.0130.00818.04
7.1.90.0060.01417.96
7.1.80.0090.01117.96
7.1.70.0090.01016.96
7.1.60.0350.01234.95
7.1.50.0230.01234.48
7.1.40.0250.01234.41
7.1.30.0190.01734.21
7.1.20.0280.02034.36
7.1.10.0070.00916.44
7.1.00.0090.01016.49

preferences:
31.36 ms | 401 KiB | 5 Q