3v4l.org

run code in 300+ PHP versions simultaneously
<?php $config = array( "digest_alg" => "sha512", "private_key_bits" => 512, "private_key_type" => OPENSSL_KEYTYPE_RSA, ); // Create the private and public key $res = openssl_pkey_new($config); // Extract the private key from $res to $privKey openssl_pkey_export($res, $privKey); // Extract the public key from $res to $pubKey $pubKey = openssl_pkey_get_details($res); $pubKey = $pubKey["key"]; $data = 'plaintext data goes here'; // Encrypt the data to $encrypted using the public key openssl_public_encrypt($data, $encrypted, $pubKey); // Decrypt the data using the private key and store the results in $decrypted openssl_private_decrypt($encrypted, $decrypted, $privKey); echo $decrypted;

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.0180.00016.88
8.3.50.0000.01518.14
8.3.40.0040.01118.51
8.3.30.0140.00318.71
8.3.20.0000.00820.16
8.3.10.0070.00023.71
8.3.00.0040.00418.04
8.2.180.0180.00418.54
8.2.170.0090.00622.96
8.2.160.0140.00020.19
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.00917.50
8.2.110.0090.00322.14
8.2.100.0060.00618.05
8.2.90.0040.00419.25
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0110.00019.38
8.2.30.0070.00020.63
8.2.20.0000.00817.82
8.2.10.0030.00618.14
8.2.00.0040.00418.18
8.1.270.0100.00324.02
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0110.00022.66
8.1.230.0080.00417.66
8.1.220.0090.00017.74
8.1.210.0090.00018.77
8.1.200.0050.00517.38
8.1.190.0040.00417.25
8.1.180.0050.00518.10
8.1.170.0030.00620.44
8.1.160.0000.00722.02
8.1.150.0070.00018.71
8.1.140.0050.00319.51
8.1.130.0000.00717.53
8.1.120.0000.00817.42
8.1.110.0040.00417.41
8.1.100.0000.00717.29
8.1.90.0000.00717.40
8.1.80.0050.00317.39
8.1.70.0000.00717.41
8.1.60.0000.00717.55
8.1.50.0000.00817.38
8.1.40.0030.00617.39
8.1.30.0080.00017.67
8.1.20.0050.00317.54
8.1.10.0040.00417.49
8.1.00.0000.00717.44
8.0.300.0000.00818.77
8.0.290.0030.00516.75
8.0.280.0070.00018.57
8.0.270.0030.00517.20
8.0.260.0030.00517.28
8.0.250.0000.00717.07
8.0.240.0030.00317.04
8.0.230.0030.00317.00
8.0.220.0040.00417.00
8.0.210.0040.00416.90
8.0.200.0000.00616.94
8.0.190.0000.00717.07
8.0.180.0000.00717.00
8.0.170.0080.00017.03
8.0.160.0000.00717.06
8.0.150.0000.00716.97
8.0.140.0040.00416.90
8.0.130.0030.00313.39
8.0.120.0050.00317.04
8.0.110.0040.00416.90
8.0.100.0000.00816.97
8.0.90.0000.00716.96
8.0.80.0170.00016.96
8.0.70.0040.00416.84
8.0.60.0030.00516.80
8.0.50.0050.00316.87
8.0.30.0120.00916.85
8.0.20.0080.01217.40
8.0.10.0040.00416.90
8.0.00.0110.00716.84
7.4.330.0030.00315.20
7.4.320.0060.00016.61
7.4.300.0070.00016.62
7.4.290.0000.00716.46
7.4.280.0040.00416.49
7.4.270.0000.00616.52
7.4.260.0040.00416.50
7.4.250.0020.00516.40
7.4.240.0030.00316.52
7.4.230.0000.00816.61
7.4.220.0040.01416.63
7.4.210.0040.01116.70
7.4.200.0000.00716.37
7.4.160.0120.00416.66
7.4.150.0150.00517.40
7.4.140.0090.01017.86
7.4.130.0140.00616.61
7.4.120.0100.00616.52
7.4.110.0030.01416.54
7.4.100.0060.01216.39
7.4.90.0070.01016.55
7.4.80.0100.00719.39
7.4.70.0030.01416.60
7.4.60.0030.01316.42
7.4.50.0030.00616.59
7.4.40.0090.01216.53
7.4.30.0170.00416.65
7.4.00.0080.00814.69
7.3.330.0000.00713.10
7.3.320.0000.00513.23
7.3.310.0030.00316.35
7.3.300.0030.00316.17
7.3.290.0080.00716.24
7.3.280.0110.00616.27
7.3.270.0160.00017.40
7.3.260.0150.00916.29
7.3.250.0060.01216.44
7.3.240.0080.01216.48
7.3.230.0090.00916.46
7.3.210.0130.00316.32
7.3.200.0140.00716.27
7.3.190.0110.00916.60
7.3.180.0030.01316.54
7.3.170.0060.00916.36
7.3.160.0090.00616.55
7.3.120.0070.01014.82
7.3.110.0100.00714.52
7.3.100.0120.00314.54
7.3.90.0040.01214.44
7.3.80.0000.00914.44
7.3.70.0070.00414.82
7.3.60.0060.00614.86
7.3.50.0030.01314.90
7.3.40.0030.00914.82
7.3.30.0060.00614.60
7.3.20.0030.01016.55
7.3.10.0000.01116.53
7.3.00.0090.00616.47
7.2.330.0160.00616.72
7.2.320.0110.00716.52
7.2.310.0100.00716.47
7.2.300.0100.00616.73
7.2.290.0060.01016.25
7.2.250.0090.00914.95
7.2.240.0040.01515.08
7.2.230.0000.01114.85
7.2.220.0030.00714.73
7.2.210.0040.00814.84
7.2.200.0090.00614.92
7.2.190.0100.00614.55
7.2.180.0030.01314.73
7.2.170.0000.01114.91
7.2.60.0000.01716.79
7.2.00.0070.01019.59
7.1.330.0070.00715.65
7.1.320.0090.00615.72
7.1.310.0120.00315.45
7.1.300.0030.01015.70
7.1.290.0000.01015.59
7.1.280.0000.01415.70
7.1.270.0040.00415.84
7.1.260.0030.01015.56
7.1.200.0050.00615.64
7.1.100.0000.01518.07
7.1.70.0110.00417.26
7.1.60.0090.01519.11
7.1.50.0000.01417.02
7.1.00.0000.08722.71
7.0.200.0270.01014.92
7.0.60.0100.07320.20
7.0.50.0030.07717.90
7.0.40.0030.06720.44
7.0.30.0330.08320.48
7.0.20.0170.04320.30
7.0.10.0100.05320.45
7.0.00.0070.09320.16
5.6.280.0070.03320.97
5.6.210.0100.06720.68
5.6.200.0000.05018.35
5.6.190.0030.05320.80
5.6.180.4330.05320.65
5.6.170.0230.07720.66
5.6.160.0000.09720.65
5.6.150.0130.03018.40
5.6.140.0100.08318.42
5.6.130.0070.08718.41
5.6.120.0100.05721.16
5.6.110.0170.05321.38
5.6.100.0100.08721.31
5.6.90.0000.10021.14
5.6.80.0100.05720.58
5.6.70.0030.06320.54
5.5.350.0100.06720.52
5.5.340.0030.08018.15
5.5.330.0200.08320.48
5.5.320.0500.05720.59
5.5.310.0170.04320.48
5.5.300.0070.04718.12
5.5.290.0030.09318.08
5.5.280.0130.08320.86
5.5.270.0230.07020.86
5.5.260.0270.07321.09
5.5.250.0170.08020.96
5.5.240.0300.07720.39
5.4.450.0600.06719.85
5.4.440.0500.07319.62
5.4.430.0530.07019.46
5.4.420.0630.08319.65
5.4.410.0100.06319.51
5.4.400.0600.06719.46
5.4.390.0530.08018.99
5.4.380.0700.07019.03
5.4.370.0130.07019.29
5.4.360.0170.06719.36
5.4.350.0530.08719.17
5.4.340.0200.08019.03
5.4.320.0530.06719.33
5.4.310.0770.06019.36
5.4.300.0270.07319.51
5.4.290.0200.06019.30
5.4.280.0170.06319.45
5.4.270.0230.06319.14
5.4.260.0130.07719.13
5.4.250.0370.06319.34
5.4.240.0200.06319.02
5.4.230.0200.05319.30
5.4.220.0070.06719.42
5.4.210.0170.08019.44
5.4.200.0200.08718.98
5.4.190.0370.06719.30
5.4.180.0430.06719.15
5.4.170.0430.06319.30
5.4.160.0270.06319.27
5.4.150.0200.07319.29
5.4.140.0170.05716.47
5.4.130.0170.05016.21
5.4.120.0200.04716.46
5.4.110.0300.06316.29
5.4.100.0300.05316.18
5.4.90.0230.06716.36
5.4.80.0300.06016.20
5.4.70.0330.06016.45
5.4.60.0100.06316.44
5.4.50.0270.05016.48
5.4.40.0130.07016.42
5.4.30.0300.05016.52
5.4.20.0100.05316.42
5.4.10.0230.04316.50
5.4.00.0300.05015.91

preferences:
56.5 ms | 400 KiB | 5 Q