3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keypair = sodium_crypto_box_keypair(); $sk = sodium_crypto_box_secretkey($keypair); $pk = sodium_crypto_box_publickey($keypair); var_dump([ 'secret key' => bin2hex($sk), 'public key' => bin2hex($pk) ]); $pk_from_sk = sodium_crypto_scalarmult_base($sk); var_dump([ 'public key from secret key' => bin2hex($pk_from_sk) ]);

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)
8.3.130.0080.00018.50
8.3.120.0060.01018.94
8.3.110.0100.00020.94
8.3.100.0080.00024.06
8.3.90.0030.00626.77
8.3.80.0030.00616.38
8.3.70.0070.00716.58
8.3.60.0110.01118.18
8.3.50.0080.00817.17
8.3.40.0150.00018.71
8.3.30.0060.00918.85
8.3.20.0090.00619.14
8.3.10.0040.00423.83
8.3.00.0070.00020.89
8.2.250.0080.00016.57
8.2.240.0030.00617.22
8.2.230.0040.00422.58
8.2.220.0100.00737.54
8.2.210.0130.00626.77
8.2.200.0060.00316.63
8.2.190.0090.00916.75
8.2.180.0070.00725.92
8.2.170.0150.00619.04
8.2.160.0140.00022.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0040.00421.02
8.2.110.0050.00520.54
8.2.100.0090.00318.16
8.2.90.0030.00518.22
8.2.80.0090.00017.97
8.2.70.0040.00418.03
8.2.60.0100.00218.09
8.2.50.0080.00018.10
8.2.40.0080.00021.02
8.2.30.0040.00420.59
8.2.20.0030.00618.13
8.2.10.0030.00519.81
8.2.00.0000.00719.43
8.1.300.0080.00016.33
8.1.290.0060.00318.88
8.1.280.0160.00025.92
8.1.270.0050.00322.08
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0070.00319.20
8.1.230.0090.00322.63
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0030.00617.23
8.1.190.0090.00017.25
8.1.180.0090.00018.10
8.1.170.0060.00318.65
8.1.160.0030.00618.80
8.1.150.0000.00718.93
8.1.140.0090.00018.96
8.1.130.0000.00719.08
8.1.120.0020.00517.41
8.1.110.0000.00717.33
8.1.100.0000.00717.38
8.1.90.0040.00417.36
8.1.80.0080.00017.38
8.1.70.0000.00717.40
8.1.60.0030.00617.42
8.1.50.0000.00817.35
8.1.40.0000.00817.45
8.1.30.0050.00317.60
8.1.20.0000.00717.53
8.1.10.0030.00617.49
8.1.00.0050.00317.44
8.0.300.0000.00819.67
8.0.290.0040.00416.74
8.0.280.0040.00418.51
8.0.270.0070.00017.28
8.0.260.0030.00320.28
8.0.250.0000.00716.93
8.0.240.0030.00716.92
8.0.230.0080.00017.00
8.0.220.0000.00716.95
8.0.210.0000.00716.89
8.0.200.0040.00416.97
8.0.190.0000.00716.95
8.0.180.0000.00816.91
8.0.170.0060.00316.76
8.0.160.0000.00816.92
8.0.150.0050.00216.76
8.0.140.0050.00316.74
8.0.130.0030.00313.29
8.0.120.0000.00716.65
8.0.110.0040.00416.89
8.0.100.0070.00016.91
8.0.90.0040.00416.90
8.0.80.0060.00816.83
8.0.70.0040.00416.71
8.0.60.0050.00316.83
8.0.50.0000.00816.66
8.0.30.0150.00717.04
8.0.20.0130.00617.40
8.0.10.0000.00716.99
8.0.00.0070.01016.61
7.4.330.0000.00415.55
7.4.320.0000.00616.52
7.4.300.0030.00516.49
7.4.290.0030.00316.52
7.4.280.0000.01016.52
7.4.270.0000.00716.59
7.4.260.0030.00316.45
7.4.250.0000.00716.58
7.4.240.0030.00316.47
7.4.230.0000.00716.51
7.4.220.0040.00416.37
7.4.210.0070.00716.47
7.4.200.0070.00016.61
7.4.160.0080.01016.49
7.4.140.0120.00817.86
7.4.130.0000.01716.56
7.4.120.0120.00916.44
7.4.110.0100.00616.38
7.4.100.0060.01216.29
7.4.90.0100.00716.70
7.4.80.0140.00319.39
7.4.70.0090.00916.42
7.4.60.0070.01116.49
7.4.50.0090.00216.55
7.4.40.0110.01216.54
7.4.00.0080.00815.16
7.3.330.0000.00513.13
7.3.320.0040.00413.14
7.3.310.0030.00416.18
7.3.300.0000.00716.21
7.3.290.0030.00316.26
7.3.280.0110.00516.18
7.3.260.0120.00716.19
7.3.240.0120.00916.36
7.3.230.0110.00816.32
7.3.210.0130.00316.33
7.3.200.0130.00916.51
7.3.190.0140.01116.19
7.3.180.0090.01316.38
7.3.170.0170.00316.32
7.3.160.0140.00416.26
7.2.330.0100.00916.28
7.2.320.0140.00616.50
7.2.310.0120.00616.29
7.2.300.0040.01416.60
7.2.290.0090.01216.64
7.2.100.1050.00314.41
7.2.90.1910.00914.56
7.2.80.1870.00814.54
7.2.70.0580.01214.92
7.2.60.0690.01015.02
7.2.50.0620.00614.95
7.2.40.0440.01014.77
7.2.30.0530.00615.03
7.2.20.0530.01014.77
7.2.10.0760.01114.86
7.2.00.0480.01214.89
7.1.220.0680.01013.66
7.1.210.2280.00813.58
7.1.200.1730.00513.72
7.1.190.0280.01113.69
7.1.180.0570.00613.46
7.1.170.1610.00813.55
7.1.160.0330.00913.65
7.1.150.0500.01013.77
7.1.140.0730.01013.73
7.1.130.1040.01013.63
7.1.120.0420.00613.73
7.1.110.0530.00213.71
7.1.100.0390.01013.67
7.1.90.0710.00513.72
7.1.80.0620.00813.79
7.1.70.0560.00713.58
7.1.60.0590.01431.64
7.1.50.0660.00831.85
7.1.40.0760.01131.89
7.1.30.0700.01231.79
7.1.20.0950.01431.74
7.1.10.0670.00313.68
7.1.00.0800.00613.65
7.0.310.2080.01013.35
7.0.300.0920.01013.24
7.0.290.0740.00913.24
7.0.280.0130.00813.37
7.0.270.1680.00613.24
7.0.260.0730.00313.48
7.0.250.0880.00313.58
7.0.240.0810.00313.41
7.0.230.0700.00313.26
7.0.220.0600.00313.41
7.0.210.0830.00613.43
7.0.200.0650.00713.19
7.0.190.1190.00313.25
7.0.180.1090.00313.49
7.0.170.1110.00313.32
7.0.160.0690.00713.46
7.0.150.0950.01313.29
7.0.140.0980.00613.46
7.0.130.0800.00013.52
7.0.120.0870.01013.45
7.0.110.2070.00713.54
7.0.100.0860.00313.34
7.0.90.1170.00613.52
7.0.80.0950.00913.45
7.0.70.0720.00713.50
7.0.60.0560.00713.18
7.0.50.0980.00913.67
7.0.40.1010.00313.43
7.0.30.0860.00713.64
7.0.20.0950.01013.23
7.0.10.0820.00313.40
7.0.00.0880.00013.32
5.6.380.0120.00413.97
5.6.370.0140.00714.02
5.6.360.0150.00513.84
5.6.350.0080.01113.97
5.6.340.0120.00914.21
5.6.330.0160.00613.88
5.6.320.0180.00414.32
5.6.310.0160.00314.09
5.6.300.0130.00614.14
5.6.290.0150.00614.18
5.6.280.0130.00914.36
5.6.270.0080.01513.97
5.6.260.0160.00714.27
5.6.250.0090.01313.95
5.6.240.0040.01414.06
5.6.230.0100.01014.02
5.6.220.0030.01614.05
5.6.210.0170.00014.02
5.6.200.0210.00014.11
5.6.190.0100.01014.23
5.6.180.0070.01514.13
5.6.170.0090.00913.86
5.6.160.0060.01213.79
5.6.150.0120.00614.34
5.6.140.0050.01414.24
5.6.130.0200.00014.26
5.6.120.0080.01413.84
5.6.110.0110.01014.19
5.6.100.0180.00414.14
5.6.90.0170.00314.03
5.6.80.0130.00713.86
5.6.70.0100.01013.91
5.6.60.0150.00613.79
5.6.50.0080.01314.16
5.6.40.0040.01513.87
5.6.30.0050.01414.04
5.6.20.0160.00514.20
5.6.10.0170.00413.89
5.6.00.0140.00613.91
5.5.380.0120.00611.05
5.5.370.0040.01111.05
5.5.360.0100.00511.05
5.5.350.0090.00411.05
5.5.340.0120.00411.05
5.5.330.0070.01011.05
5.5.320.0160.00011.05
5.5.310.0060.00611.05
5.5.300.0160.00311.05
5.5.290.0100.00711.05
5.5.280.0110.00611.05
5.5.270.0040.01211.05
5.5.260.0090.00511.05
5.5.250.0120.00411.05
5.5.240.0120.00411.05
5.5.230.0120.00011.05
5.5.220.0090.00411.05
5.5.210.0080.00811.05
5.5.200.0110.00711.05
5.5.190.0100.00511.05
5.5.180.0080.00811.05
5.5.170.0180.00414.06
5.5.160.0040.01211.05
5.5.150.0130.00311.05
5.5.140.0130.00311.05
5.5.130.0120.00411.05
5.5.120.0110.00311.05
5.5.110.0090.00911.05
5.5.100.0080.00611.05
5.5.90.0120.00311.05
5.5.80.0060.00911.05
5.5.70.0120.00311.05
5.5.60.0120.00311.05
5.5.50.0150.00011.05
5.5.40.0090.00411.05
5.5.30.0040.00811.05
5.5.20.0120.00411.05
5.5.10.0110.00211.05
5.5.00.0120.00411.05
5.4.450.0110.00311.05
5.4.440.0110.00711.05
5.4.430.0080.00811.05
5.4.420.0160.00011.05
5.4.410.0080.00711.05
5.4.400.0110.00511.05
5.4.390.0110.00511.05
5.4.380.0130.00211.05
5.4.370.0070.00711.05
5.4.360.0110.00411.05
5.4.350.0090.00511.05
5.4.340.0090.00611.05
5.4.330.0100.00511.05
5.4.320.0130.00311.05
5.4.310.0060.00911.05
5.4.300.0050.01111.05
5.4.290.0040.01011.05
5.4.280.0080.00611.05
5.4.270.0060.00911.05
5.4.260.0100.00311.05
5.4.250.0070.00711.05
5.4.240.0090.00511.05
5.4.230.0120.00011.05
5.4.220.0110.00511.05
5.4.210.0100.00511.05
5.4.200.0140.00311.05
5.4.190.0050.00911.05
5.4.180.0110.00311.05
5.4.170.0120.00411.05
5.4.160.0090.00611.05
5.4.150.0120.00311.05
5.4.140.0070.00711.05
5.4.130.0070.00711.05
5.4.120.0070.00711.05
5.4.110.0080.00311.05
5.4.100.0140.00311.05
5.4.90.0110.00511.05
5.4.80.0140.00511.05
5.4.70.0090.00611.05
5.4.60.0080.00411.05
5.4.50.0080.00611.05
5.4.40.0060.00811.05
5.4.30.0060.01011.05
5.4.20.0140.00011.05
5.4.10.0070.00711.05
5.4.00.0080.00711.05
5.3.290.0130.00311.05
5.3.280.0100.00511.05
5.3.270.0030.00711.05
5.3.260.0050.01011.05
5.3.250.0150.00011.05
5.3.240.0080.00311.05
5.3.230.0120.00011.05
5.3.220.0140.00011.05
5.3.210.0060.00611.05
5.3.200.0090.00311.05
5.3.190.0060.00911.05
5.3.180.0100.00311.05
5.3.170.0050.00511.05
5.3.160.0110.00411.05
5.3.150.0090.00611.05
5.3.140.0070.00711.05
5.3.130.0110.00311.05
5.3.120.0070.00711.05
5.3.110.0130.00311.05
5.3.100.0040.00711.05
5.3.90.0050.01011.05
5.3.80.0000.01211.05
5.3.70.0090.00511.05
5.3.60.0080.00411.05
5.3.50.0120.00611.05
5.3.40.0080.00811.05
5.3.30.0080.00311.05
5.3.20.0050.01011.05
5.3.10.0060.00611.05
5.3.00.0070.00411.05
5.2.170.0110.00011.05
5.2.160.0050.00511.05
5.2.150.0060.00611.05
5.2.140.0040.00411.05
5.2.130.0070.00511.05
5.2.120.0000.01211.05
5.2.110.0080.00311.05
5.2.100.0080.00311.05
5.2.90.0080.00411.05
5.2.80.0060.00611.05
5.2.70.0060.00611.05
5.2.60.0040.00711.05
5.2.50.0080.00311.05
5.2.40.0100.00211.05
5.2.30.0030.00611.05
5.2.20.0050.00611.05
5.2.10.0100.00311.05
5.2.00.0100.00011.05
5.1.60.0000.00911.05
5.1.50.0120.00011.05
5.1.40.0090.00511.05
5.1.30.0070.00411.05
5.1.20.0100.00011.05
5.1.10.0000.01011.05
5.1.00.0050.00311.05
5.0.50.0040.00411.05
5.0.40.0070.00011.05
5.0.30.0060.00311.05
5.0.20.0000.00611.05
5.0.10.0060.00311.05
5.0.00.0000.00711.05
4.4.90.0000.00711.05
4.4.80.0080.00011.05
4.4.70.0040.00411.05
4.4.60.0040.00411.05
4.4.50.0040.00411.05
4.4.40.0060.00311.05
4.4.30.0030.00511.05
4.4.20.0040.00411.05
4.4.10.0030.00311.05
4.4.00.0030.00311.05
4.3.110.0080.00011.05
4.3.100.0000.00911.05
4.3.90.0030.00311.05
4.3.80.0070.00011.05
4.3.70.0020.00511.05
4.3.60.0080.00011.05
4.3.50.0000.00911.05
4.3.40.0040.00211.05
4.3.30.0000.00711.05
4.3.20.0000.00611.05
4.3.10.0000.00511.05
4.3.00.0060.00211.05

preferences:
30.58 ms | 403 KiB | 5 Q