3v4l.org

run code in 300+ PHP versions simultaneously
<?php $private_key_string = <<<__EOF__ -----BEGIN RSA PRIVATE KEY----- MIIBOwIBAAJBANWj431rbsGw3f6rmED2gN0sKaxxDGvFB/M+o6OwnHGEtz7tL1bz J3wUEHzUkt4EelafK7KHNfOZ45mwmeviPn8CAwEAAQJAYj3oKc+Scf1cSHUuIYl5 fruFOmgN9yz21/ORGn/noQc4HS04VynMhzojs5MVIGTFVW1KTn8L4CdQ9iIHHPO4 SQIhAPkb7XKPrCif9XnJSa8l2roMzBYbUXQeeMHW46OzehGlAiEA24zJgypJ3F8t FLqRwXLH0eMr1D50vbPWcmeAWx5hjlMCIQCtPIa8jL2k4tjLgPgFHcYmbI/hL85N eoNwCgj05vOVIQIgScOUlNgpdrwXhmZkwE0TK8aanDXbvTzl6QwzSOn9NvcCIQCS zYIZywZTRueYk3YQCTX3ofnQad7M9X2802tWqm0q6A== -----END RSA PRIVATE KEY----- __EOF__; $public_key_string = <<<__EOF__ -----BEGIN PUBLIC KEY----- MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANWj431rbsGw3f6rmED2gN0sKaxxDGvF B/M+o6OwnHGEtz7tL1bzJ3wUEHzUkt4EelafK7KHNfOZ45mwmeviPn8CAwEAAQ== -----END PUBLIC KEY----- __EOF__; $private_key = openssl_pkey_get_private($private_key_string); $public_key = openssl_pkey_get_public($public_key_string); if (!$private_key) { echo "Cannot get private key\n"; } if (!$public_key) { echo "Cannot get public key\n"; } $input = "abc"; echo "input: $input\n"; openssl_public_encrypt($input, $crypttext, $public_key); openssl_private_decrypt($crypttext, $decoded, $private_key); echo "encrypted: " . base64_encode($crypttext) . "\n"; echo "decrypted: $decoded\n"; $encrypted_encoded = "0aO2tBOUdXrXkASzjnYKydq+WDj6URLvBdKOhxbkXp2/kRTjOb4cGDxBURLGoJPi53rNlNsk8AVEB9e2AkWF1Q=="; $encrypted = base64_decode($encrypted_encoded); openssl_private_decrypt($encrypted, $decrypted, $private_key); echo "decrypted: $decrypted\n";

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.90.0060.00326.77
8.3.80.0000.01017.97
8.3.70.0120.00616.63
8.3.60.0090.01218.31
8.3.50.0130.00922.87
8.3.40.0090.00618.88
8.3.30.0000.01418.84
8.3.20.0070.00020.30
8.3.10.0040.00420.56
8.3.00.0080.00020.71
8.2.210.0050.00326.77
8.2.200.0090.00016.38
8.2.190.0090.00916.88
8.2.180.0090.00618.26
8.2.170.0000.01522.96
8.2.160.0100.00322.13
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00919.39
8.2.120.0080.00026.35
8.2.110.0100.00020.39
8.2.100.0090.00317.84
8.2.90.0000.00817.75
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0090.00017.93
8.2.50.0060.00318.07
8.2.40.0110.00017.97
8.2.30.0060.00317.90
8.2.20.0000.00717.61
8.2.10.0040.00418.04
8.2.00.0040.00417.99
8.1.290.0070.00330.84
8.1.280.0070.00725.92
8.1.270.0060.00323.83
8.1.260.0040.00428.09
8.1.250.0060.00328.09
8.1.240.0040.00420.84
8.1.230.0070.00419.16
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0040.00817.23
8.1.190.0000.00817.10
8.1.180.0090.00018.10
8.1.170.0040.00418.38
8.1.160.0000.00818.72
8.1.150.0040.00618.72
8.1.140.0030.00619.58
8.1.130.0000.00717.66
8.1.120.0000.00817.45
8.1.110.0040.00417.43
8.1.100.0050.00317.45
8.1.90.0000.00717.38
8.1.80.0030.00617.32
8.1.70.0040.00417.32
8.1.60.0060.00317.47
8.1.50.0050.00417.58
8.1.40.0040.00417.57
8.1.30.0000.00817.68
8.1.20.0080.00017.71
8.1.10.0040.00417.61
8.1.00.0040.00417.53
8.0.300.0080.00419.39
8.0.290.0000.00816.75
8.0.280.0030.00318.34
8.0.270.0000.00717.09
8.0.260.0000.00617.13
8.0.250.0030.00316.85
8.0.240.0030.00316.89
8.0.230.0070.00016.88
8.0.220.0030.00416.77
8.0.210.0040.00416.78
8.0.200.0000.00716.85
8.0.190.0040.00416.90
8.0.180.0040.00416.91
8.0.170.0060.00317.00
8.0.160.0000.00716.94
8.0.150.0000.00816.91
8.0.140.0000.00716.86
8.0.130.0000.00613.40
8.0.120.0040.00416.89
8.0.110.0000.00716.89
8.0.100.0040.00416.76
8.0.90.0000.00716.96
8.0.80.0070.01417.00
8.0.70.0040.00416.91
8.0.60.0040.00416.92
8.0.50.0040.00416.95
8.0.30.0110.00817.06
8.0.20.0030.01517.40
8.0.10.0070.00016.98
8.0.00.0080.01016.63
7.4.330.0060.00015.08
7.4.320.0070.00016.57
7.4.300.0060.00016.55
7.4.290.0030.00316.54
7.4.280.0050.00316.60
7.4.270.0000.00716.53
7.4.260.0040.00416.52
7.4.250.0030.00516.52
7.4.240.0040.00416.59
7.4.230.0070.00016.55
7.4.220.0110.00816.73
7.4.210.0120.00316.59
7.4.200.0000.00716.46
7.4.160.0080.00816.54
7.4.150.0100.01317.40
7.4.140.0120.00617.86
7.4.130.0100.01216.56
7.4.120.0120.00516.47
7.4.110.0130.00616.59
7.4.100.0100.00716.53
7.4.90.0110.00716.36
7.4.80.0150.00919.39
7.4.70.0130.00316.54
7.4.60.0080.00816.42
7.4.50.0110.00316.39
7.4.40.0130.01016.50
7.4.30.0140.00416.57
7.4.00.0060.00914.76
7.3.330.0000.00513.00
7.3.320.0000.00513.25
7.3.310.0030.00516.35
7.3.300.0070.00016.18
7.3.290.0060.01116.25
7.3.280.0120.00816.26
7.3.270.0120.00617.40
7.3.260.0120.00616.28
7.3.250.0130.00616.51
7.3.240.0100.01016.27
7.3.230.0030.01316.39
7.3.210.0090.00616.43
7.3.200.0130.00916.31
7.3.190.0070.01016.47
7.3.180.0100.00616.52
7.3.170.0090.00616.41
7.3.160.0040.01116.25
7.3.120.0090.00614.65
7.3.110.0070.01014.69
7.3.100.0090.00614.86
7.3.90.0080.00815.03
7.3.80.0030.00614.79
7.3.70.0040.01114.77
7.3.60.0070.00314.66
7.3.50.0000.01514.84
7.3.40.0040.01114.75
7.3.30.0000.01414.79
7.3.20.0000.01316.51
7.3.10.0070.01016.59
7.3.00.0100.00716.55
7.2.330.0070.01716.41
7.2.320.0290.01316.54
7.2.310.0170.00016.70
7.2.300.0100.00716.54
7.2.290.0030.01316.31
7.2.240.0040.01515.00
7.2.230.0130.00315.23
7.2.220.0000.01714.87
7.2.210.0090.00614.94
7.2.200.0080.00414.98
7.2.190.0070.01015.04
7.2.180.0070.00714.87
7.2.170.0070.01014.89
7.2.160.0140.00414.95
7.2.150.0030.01316.73
7.2.140.0000.01016.50
7.2.130.0000.01016.82
7.2.120.0130.00316.56
7.2.110.0030.00616.70
7.2.100.0040.01116.79
7.2.90.0070.00716.75
7.2.80.0060.00316.68
7.2.70.0030.01316.59
7.2.60.0080.00916.69
7.2.50.0000.01216.84
7.2.40.0000.01616.75
7.2.30.0090.00616.84
7.2.20.0060.00616.84
7.2.10.0060.00916.57
7.2.00.0060.00918.24
7.1.330.0060.00815.68
7.1.320.0070.00715.76
7.1.310.0000.00915.36
7.1.300.0080.00415.51
7.1.290.0030.00715.45
7.1.280.0030.01015.41
7.1.270.0100.00315.33
7.1.260.0130.00015.73
7.1.250.0060.00915.42
7.1.200.0070.00315.45
7.1.100.0240.00316.69
7.1.70.0030.00617.36
7.1.60.0150.00919.61
7.1.50.0090.01217.21
7.1.00.0070.07322.47
7.0.200.0310.00315.26
7.0.60.0030.03021.95
7.0.50.0070.08017.93
7.0.40.0030.04720.34
7.0.30.0300.04320.42
7.0.20.0200.03720.13
7.0.10.0100.08320.30
7.0.00.0070.09020.34
5.6.280.0070.07021.25
5.6.210.0100.07020.66
5.6.200.0100.07318.38
5.6.190.0130.07020.74
5.6.180.0270.08720.90
5.6.170.0430.07020.64
5.6.160.0070.05720.50
5.6.150.0030.04318.41
5.6.140.0030.05018.23
5.6.130.0000.05018.33
5.6.120.0070.08021.24
5.6.110.0100.07321.11
5.6.100.0200.04321.21
5.6.90.0100.08021.14
5.6.80.0100.08020.45
5.5.350.2970.03320.64
5.5.340.0100.03318.18
5.5.330.0070.08720.38
5.5.320.0370.04720.52
5.5.310.0300.05320.47
5.5.300.0030.04318.13
5.5.290.0070.05718.17
5.5.280.0000.09320.99
5.5.270.0030.04720.80
5.5.260.0170.07320.89
5.5.250.0100.06020.93
5.5.240.0030.07320.22

preferences:
29.73 ms | 401 KiB | 5 Q