3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $key должен быть сгенерирован заранее криптографически безопасным образом // например, с помощью openssl_random_pseudo_bytes $plaintext = "данные для шифрования"; $cipher = "aes-128-gcm"; if(function_exists('openssl_get_cipher_methods')){ if (in_array($cipher, openssl_get_cipher_methods())) { $ivlen = openssl_cipher_iv_length($cipher); $iv = openssl_random_pseudo_bytes($ivlen); $ciphertext = openssl_encrypt($plaintext, $cipher, $key, $options=0, $iv, $tag); // сохраняем $cipher, $iv и $tag для дальнейшей расшифровки $original_plaintext = openssl_decrypt($ciphertext, $cipher, $key, $options=0, $iv, $tag); echo $original_plaintext."\n"; }}else{ echo 'function openssl_get_cipher_methods IS NOT'; }

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.0140.00718.30
8.3.50.0070.01416.39
8.3.40.0100.01018.69
8.3.30.0180.00318.72
8.3.20.0000.00821.90
8.3.10.0070.00723.65
8.3.00.0040.00420.77
8.2.180.0110.00718.29
8.2.170.0160.00622.96
8.2.160.0070.01019.91
8.2.150.0070.01324.18
8.2.140.0140.00324.66
8.2.130.0090.00919.77
8.2.120.0080.00026.35
8.2.110.0040.00421.01
8.2.100.0070.00417.76
8.2.90.0030.00618.22
8.2.80.0000.00718.05
8.2.70.0030.00718.04
8.2.60.0050.00318.09
8.2.50.0040.00418.10
8.2.40.0030.00619.48
8.2.30.0080.00019.07
8.2.20.0000.00718.04
8.2.10.0040.00419.23
8.2.00.0030.00519.34
8.1.280.0120.00925.92
8.1.270.0060.00918.91
8.1.260.0150.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00920.74
8.1.230.0040.00720.89
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.22
8.1.190.0090.00317.11
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0000.00718.74
8.1.150.0070.00018.75
8.1.140.0060.00320.63
8.1.130.0000.00620.14
8.1.120.0070.00017.39
8.1.110.0070.00017.39
8.1.100.0000.00717.28
8.1.90.0040.00417.29
8.1.80.0040.00417.28
8.1.70.0030.00517.29
8.1.60.0080.00017.48
8.1.50.0040.00417.39
8.1.40.0000.00817.39
8.1.30.0080.00017.59
8.1.20.0040.00417.46
8.1.10.0000.00917.48
8.1.00.0080.00017.43
8.0.300.0000.00720.04
8.0.290.0040.00416.63
8.0.280.0030.00318.51
8.0.270.0030.00317.21
8.0.260.0000.00618.48
8.0.250.0000.00716.77
8.0.240.0040.00416.94
8.0.230.0070.00016.80
8.0.220.0040.00416.88
8.0.210.0040.00316.89
8.0.200.0000.00816.77
8.0.190.0000.00716.88
8.0.180.0000.00816.69
8.0.170.0060.00316.84
8.0.160.0040.00416.73
8.0.150.0000.00716.69
8.0.140.0080.00016.79
8.0.130.0030.00313.20
8.0.120.0040.00416.84
8.0.110.0080.00016.63
8.0.100.0000.00816.73
8.0.90.0030.00316.71
8.0.80.0110.01516.84
8.0.70.0080.00016.71
8.0.60.0070.00016.73
8.0.50.0000.00716.65
8.0.30.0140.00317.04
8.0.20.0070.01717.40
8.0.10.0030.00316.95
8.0.00.0110.01016.66
7.4.330.0030.00315.55
7.4.320.0030.00316.38
7.4.300.0000.00616.40
7.4.290.0050.00216.44
7.4.280.0050.00316.42
7.4.270.0000.00716.37
7.4.260.0070.00016.34
7.4.250.0000.00716.38
7.4.240.0030.00316.46
7.4.230.0000.00716.62
7.4.220.0040.00416.40
7.4.210.0080.01116.49
7.4.200.0070.00016.28
7.4.160.0040.01216.40
7.4.140.0110.00917.86
7.4.130.0090.00916.50
7.4.120.0120.00616.52
7.4.110.0090.00916.45
7.4.100.0110.00516.30
7.4.90.0070.01016.28
7.4.80.0090.00619.39
7.4.70.0100.00716.49
7.4.60.0110.00816.43
7.4.50.0000.01216.63
7.4.40.0060.01216.48
7.4.00.0070.01114.86
7.3.330.0050.00012.99
7.3.320.0000.00612.81
7.3.310.0030.00315.99
7.3.300.0040.00416.09
7.3.290.0000.00716.17
7.3.280.0070.00716.08
7.3.260.0110.00816.30
7.3.240.0120.00716.37
7.3.230.0100.00616.42
7.3.210.0040.01416.11
7.3.200.0060.01016.10
7.3.190.0060.01016.10
7.3.180.0130.00316.40
7.3.170.0060.01616.30
7.3.160.0060.01216.43
7.3.120.0060.00814.55
7.3.110.0080.01014.68
7.3.100.0060.01114.72
7.3.90.0060.01014.80
7.3.80.0010.01414.71
7.3.70.0080.00514.64
7.3.60.0030.01014.62
7.3.50.0080.00614.63
7.3.40.0020.01014.72
7.3.30.0070.00714.72
7.3.20.0060.00716.56
7.3.10.1240.00715.96
7.3.00.1140.00716.04
7.2.330.0040.01416.57
7.2.320.0120.00916.62
7.2.310.0060.01216.33
7.2.300.0100.00616.25
7.2.290.0090.01016.23
7.2.250.0090.00814.74
7.2.240.0070.01114.82
7.2.230.0040.01114.96
7.2.220.0050.00914.74
7.2.210.0050.00915.07
7.2.200.0050.00715.02
7.2.190.0040.01014.87
7.2.180.0060.00914.98
7.2.170.0060.01015.02
7.2.160.0050.00714.84
7.2.150.0060.00916.72
7.2.140.0100.00816.77
7.2.130.0180.01216.09
7.2.120.0550.01016.07
7.2.110.0140.01216.06
7.2.100.0660.01116.04
7.2.90.0300.00616.18
7.2.80.1160.01016.02
7.2.70.1390.00715.98
7.2.60.1350.01316.05
7.2.50.1480.00216.11
7.2.40.0990.01116.17
7.2.30.0560.01116.18
7.2.20.0190.01016.12
7.2.10.1180.00916.09
7.2.00.0280.00516.00
7.1.330.0060.00915.58
7.1.320.0070.00715.72
7.1.310.0070.00515.61
7.1.300.0040.01115.57
7.1.290.0040.00715.72
7.1.280.0050.01015.58
7.1.270.0040.00915.58
7.1.260.0050.00815.74
7.1.250.0600.01014.76
7.1.240.0090.00915.47
7.1.230.0090.00315.50
7.1.220.0040.00415.27
7.1.210.0030.00715.77
7.1.200.0060.00815.42
7.1.190.0000.01415.77
7.1.180.0080.00315.57
7.1.170.0060.00615.52
7.1.160.0030.01415.75
7.1.150.0120.00315.61
7.1.140.0110.00415.76
7.1.130.0030.01015.57
7.1.120.0040.00815.70
7.1.110.0060.00615.84
7.1.100.0060.00315.66
7.1.90.0000.01015.76
7.1.80.0030.01215.59
7.1.70.0000.01315.81
7.1.60.0050.00815.48
7.1.50.0000.01015.72
7.1.40.0000.01315.71
7.1.30.0000.01115.61
7.1.20.0000.01215.45
7.1.10.0090.00015.54
7.1.00.0070.00315.75

preferences:
39.14 ms | 400 KiB | 5 Q