3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_secret = sodium_hex2bin("da93b1db433cfb2efe490a1bb263e440b586b6167c20b86f14cd058515806940"); $my_public = sodium_crypto_scalarmult_base($my_secret); $scott_secret = random_bytes(32); $scott_public = sodium_crypto_scalarmult_base($scott_secret); $my_shared_with_scott = sodium_crypto_scalarmult($my_secret, $scott_public); $scott_shared_with_me = sodium_crypto_scalarmult($scott_secret, $my_public); echo 'An attacker can only see: ', PHP_EOL; var_dump([ 'my public' => sodium_bin2hex($my_public), 'scott public' => sodium_bin2hex($scott_public) ]); echo 'Together, we calculated a shared secret for encryption: ', PHP_EOL; var_dump([ 'I see' => sodium_bin2hex($my_shared_with_scott), 'Scott sees' => sodium_bin2hex($scott_shared_with_me) ]);

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.90.3500.01014.70
7.2.80.2730.00314.37
7.2.70.4040.01014.77
7.2.60.2590.00714.93
7.2.50.2710.00315.24
7.2.40.2550.00015.30
7.2.30.2030.01015.24
7.2.20.1660.01314.86
7.2.10.1440.00714.91
7.2.00.0100.01014.99
7.1.210.5360.00713.77
7.1.200.2820.00613.77
7.1.190.2710.00013.54
7.1.180.2250.00313.66
7.1.170.2490.00713.47
7.1.160.2240.00713.58
7.1.150.2370.00713.79
7.1.140.1530.00713.46
7.1.130.0240.01413.56
7.1.120.0130.01013.76
7.1.110.1290.00713.89
7.1.100.1620.00713.67
7.1.90.2000.00713.70
7.1.80.2360.01013.80
7.1.70.2300.00713.28
7.1.60.2620.01032.02
7.1.50.3680.01031.86
7.1.40.4200.01031.68
7.1.30.0210.01731.59
7.1.20.0960.01731.63
7.1.10.1550.00613.40
7.1.00.1130.01013.76

preferences:
21.4 ms | 403 KiB | 5 Q