3v4l.org

run code in 300+ PHP versions simultaneously
<?php $config = array( "digest_alg" => "sha1", "private_key_bits" => 1024, "private_key_type" => OPENSSL_KEYTYPE_RSA, ); // Create the private and public key $res = openssl_pkey_new($config); // Create the keypair //$res=openssl_pkey_new(); // Get private key openssl_pkey_export($res, $privatekey); $privatekey=base64_encode($privatekey); // Get public key $publickey=openssl_pkey_get_details($res); $publickey=base64_encode($publickey["key"]); echo "Private Key:<BR>$privatekey<br><br>Public Key:<BR>$publickey<BR><BR>"; $string = 'It works ? Or not it works ?'; $method = 'aes128'; file_put_contents ('./file.encrypted', openssl_encrypt ($string, $method, $pass));

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.60.0150.00616.88
8.3.50.0150.00316.50
8.3.40.0140.00318.83
8.3.30.0070.00718.75
8.3.20.0030.00620.21
8.3.10.0000.00721.86
8.3.00.0080.00019.56
8.2.180.0070.01116.50
8.2.170.0110.00322.96
8.2.160.0150.00319.26
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0060.00326.16
8.2.120.0060.00317.75
8.2.110.0100.01021.12
8.2.100.0030.00917.97
8.2.90.0050.00319.22
8.2.80.0080.00017.97
8.2.70.0060.00317.75
8.2.60.0080.00417.68
8.2.50.0070.00318.07
8.2.40.0040.00419.40
8.2.30.0030.00619.96
8.2.20.0030.00517.85
8.2.10.0000.00818.12
8.2.00.0040.00418.00
8.1.280.0070.00725.92
8.1.270.0050.00322.15
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00021.28
8.1.230.0130.00017.45
8.1.220.0040.00417.78
8.1.210.0090.00018.77
8.1.200.0070.00317.38
8.1.190.0000.00817.35
8.1.180.0030.00618.10
8.1.170.0040.00418.46
8.1.160.0050.00221.92
8.1.150.0040.00418.73
8.1.140.0000.00817.39
8.1.130.0000.00717.64
8.1.120.0000.00817.45
8.1.110.0000.00717.41
8.1.100.0000.00817.39
8.1.90.0040.00417.27
8.1.80.0080.00017.39
8.1.70.0000.00717.41
8.1.60.0000.00717.48
8.1.50.0070.00017.43
8.1.40.0030.00617.48
8.1.30.0040.00717.62
8.1.20.0040.00417.55
8.1.10.0050.00317.56
8.1.00.0000.00717.33
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0070.00018.46
8.0.270.0070.00017.25
8.0.260.0040.00417.26
8.0.250.0030.00516.93
8.0.240.0050.00317.02
8.0.230.0060.00017.01
8.0.220.0000.00616.94
8.0.210.0030.00616.98
8.0.200.0030.00316.91
8.0.190.0040.00416.99
8.0.180.0070.00016.88
8.0.170.0000.00716.96
8.0.160.0000.00816.91
8.0.150.0000.00716.86
8.0.140.0090.00016.80
8.0.130.0030.00313.45
8.0.120.0040.00416.88
8.0.110.0000.00717.02
8.0.100.0040.00416.80
8.0.90.0040.00416.94
8.0.80.0060.01216.84
8.0.70.0000.00716.77
8.0.60.0040.00416.81
8.0.50.0000.00716.89
8.0.30.0100.00817.10
8.0.20.0130.00517.40
8.0.10.0040.00416.84
8.0.00.0120.00616.80
7.4.330.0020.00215.08
7.4.320.0030.00316.63
7.4.300.0050.00216.52
7.4.290.0030.00316.43
7.4.280.0080.00016.59
7.4.270.0050.00316.56
7.4.260.0040.00416.42
7.4.250.0000.00716.57
7.4.240.0050.00316.55
7.4.230.0000.00716.58
7.4.220.0090.01016.62
7.4.210.0090.00716.69
7.4.200.0030.00316.60
7.4.160.0040.01216.45
7.4.150.0090.00917.40
7.4.140.0170.00717.86
7.4.130.0070.01216.64
7.4.120.0100.00816.38
7.4.110.0150.00416.50
7.4.100.0150.00316.63
7.4.90.0120.00616.50
7.4.80.0030.01319.39
7.4.70.0030.01916.72
7.4.60.0090.00916.56
7.4.50.0000.00816.27
7.4.40.0030.01216.63
7.4.30.0040.01416.55
7.4.00.0040.00415.20
7.3.330.0000.00513.10
7.3.320.0070.00013.11
7.3.310.0030.00316.39
7.3.300.0030.00316.25
7.3.290.0030.00316.25
7.3.280.0100.00716.27
7.3.270.0120.00617.40
7.3.260.0150.00616.30
7.3.250.0150.00716.28
7.3.240.0090.00916.36
7.3.230.0130.00316.39
7.3.210.0120.00616.22
7.3.200.0100.00616.34
7.3.190.0100.00716.46
7.3.180.0070.01016.34
7.3.170.0070.01016.43
7.3.160.0080.00816.43
7.3.10.0030.00916.48
7.3.00.0060.00516.50
7.2.330.0140.00316.59
7.2.320.0130.00716.24
7.2.310.0090.01216.57
7.2.300.0200.00316.44
7.2.290.0120.00416.64
7.2.130.0050.00916.87
7.2.120.0050.00616.79
7.2.110.0050.00916.85
7.2.100.0060.00916.71
7.2.90.0090.00616.75
7.2.80.0090.00616.76
7.2.70.0050.00716.92
7.2.60.0060.00916.85
7.2.50.0030.00916.91
7.2.40.0070.00616.72
7.2.30.0080.00617.02
7.2.20.0050.00816.84
7.2.10.0030.01216.69
7.2.00.0050.00617.70
7.1.250.0010.00715.58
7.1.200.0040.00715.70
7.1.100.0030.01018.09
7.1.70.0120.00317.00
7.1.60.0030.01920.03
7.1.50.0210.00734.89
7.1.00.0000.11722.84
7.0.200.0750.00714.89
7.0.60.0000.07720.35
7.0.50.0100.09318.16
7.0.40.0100.12020.43
7.0.30.0270.12320.48
7.0.20.0330.08720.35
7.0.10.0130.10020.40
7.0.00.0200.10020.23
5.6.210.0070.05020.77
5.6.200.0070.08018.43
5.6.190.0030.10320.83
5.6.180.3530.06020.80
5.6.170.0130.07320.72
5.6.160.0070.09320.75
5.6.150.0100.09318.35
5.6.140.0070.07018.48
5.6.130.0230.08718.47
5.6.120.0030.06021.37
5.6.110.0030.09321.20
5.6.100.0070.12721.26
5.6.90.0130.07021.33
5.6.80.0070.07020.65
5.6.70.4630.06720.68
5.5.350.0100.06720.72
5.5.340.0070.05018.24
5.5.330.0100.08320.56
5.5.320.3100.06720.68
5.5.310.0370.07720.39
5.5.300.0100.05718.24
5.5.290.0030.08318.22
5.5.280.0130.11321.04
5.5.270.0070.09721.13
5.5.260.0200.03021.01
5.5.250.0200.11320.79
5.5.240.0200.08320.55
5.4.450.0400.10019.78
5.4.440.0430.07019.78
5.4.430.0630.07719.33
5.4.420.0570.07019.31
5.4.410.0570.08719.60
5.4.400.0630.08719.38
5.4.390.0630.06318.99
5.4.380.0530.07319.02
5.4.370.0670.10319.50
5.4.360.0730.07019.14
5.4.350.0570.06718.99
5.4.340.0630.06719.53
5.4.320.0730.11719.54
5.4.310.0670.07719.35
5.4.300.0630.07019.02
5.4.290.0630.07719.14
5.4.280.0430.13019.38
5.4.270.0500.06319.16
5.4.260.0430.06719.11
5.4.250.0600.06319.33
5.4.240.0730.05719.14
5.4.230.0530.08319.50
5.4.220.0730.06319.16
5.4.210.0630.09719.49
5.4.200.0430.09019.53
5.4.190.0470.07719.38
5.4.180.0470.06319.49
5.4.170.0570.09319.39
5.4.160.0570.10019.48
5.4.150.0500.06019.32
5.4.140.0430.05716.46
5.4.130.0600.03716.21
5.4.120.0600.04716.52
5.4.110.0500.06316.45
5.4.100.0430.05316.39
5.4.90.0700.04316.15
5.4.80.0630.04316.54
5.4.70.0100.04316.29
5.4.60.0300.03316.38
5.4.50.0030.03716.45
5.4.40.0230.04316.20
5.4.30.0230.07316.15
5.4.20.0170.03716.31

preferences:
52.64 ms | 400 KiB | 5 Q