3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $key должен быть сгенерирован заранее криптографически безопасным образом // например, с помощью openssl_random_pseudo_bytes $plaintext = "данные для шифрования"; $cipher = "aes-128-gcm"; if(exists_function('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.0040.01118.06
8.3.50.0110.00716.14
8.3.40.0060.01218.84
8.3.30.0110.01118.68
8.3.20.0050.00221.77
8.3.10.0140.00423.56
8.3.00.0040.00720.81
8.2.180.0070.01016.63
8.2.170.0070.01122.96
8.2.160.0070.00720.14
8.2.150.0060.00924.18
8.2.140.0110.00724.66
8.2.130.0110.00418.03
8.2.120.0110.00426.35
8.2.110.0030.00621.03
8.2.100.0110.00017.91
8.2.90.0030.00518.22
8.2.80.0080.00018.03
8.2.70.0040.00417.93
8.2.60.0000.00918.22
8.2.50.0050.00318.10
8.2.40.0030.00619.27
8.2.30.0070.00019.14
8.2.20.0040.00417.92
8.2.10.0050.00219.13
8.2.00.0050.00219.53
8.1.280.0110.00425.92
8.1.270.0030.01518.83
8.1.260.0080.01226.35
8.1.250.0040.00428.09
8.1.240.0080.00020.60
8.1.230.0040.00820.95
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00817.23
8.1.190.0130.00016.98
8.1.180.0080.00018.10
8.1.170.0000.00718.51
8.1.160.0030.00618.84
8.1.150.0040.00418.74
8.1.140.0080.00020.63
8.1.130.0070.00020.27
8.1.120.0030.00317.46
8.1.110.0040.00417.38
8.1.100.0080.00017.29
8.1.90.0030.00617.35
8.1.80.0030.00517.39
8.1.70.0000.00817.38
8.1.60.0040.00417.42
8.1.50.0040.00417.50
8.1.40.0030.00617.43
8.1.30.0000.00817.61
8.1.20.0040.00417.52
8.1.10.0040.00717.63
8.1.00.0040.00417.40
8.0.300.0000.00719.95
8.0.290.0030.00616.75
8.0.280.0070.00018.39
8.0.270.0000.00717.08
8.0.260.0040.00418.40
8.0.250.0000.00716.93
8.0.240.0040.00416.96
8.0.230.0040.00416.94
8.0.220.0000.00716.86
8.0.210.0030.00516.85
8.0.200.0000.00716.89
8.0.190.0000.00816.92
8.0.180.0040.00416.81
8.0.170.0000.00816.89
8.0.160.0000.00716.89
8.0.150.0050.00316.84
8.0.140.0000.00716.73
8.0.130.0000.00613.38
8.0.120.0040.00416.87
8.0.110.0000.00716.85
8.0.100.0050.00316.96
8.0.90.0040.00416.96
8.0.80.0090.01116.89
8.0.70.0040.00416.87
8.0.60.0050.00316.84
8.0.50.0040.00416.85
8.0.30.0070.01117.05
8.0.20.0110.00817.40
8.0.10.0040.00416.96
8.0.00.0100.01216.73
7.4.330.0070.00015.55
7.4.320.0000.00616.54
7.4.300.0030.00316.60
7.4.290.0000.00716.52
7.4.280.0050.00316.59
7.4.270.0030.00316.64
7.4.260.0070.00016.49
7.4.250.0090.00016.56
7.4.240.0050.00216.41
7.4.230.0040.00416.50
7.4.220.0030.00516.36
7.4.210.0100.00716.56
7.4.200.0030.00316.63
7.4.160.0090.00716.52
7.4.140.0120.00817.86
7.4.130.0090.00916.41
7.4.120.0180.00016.48
7.4.110.0090.00916.61
7.4.100.0160.00316.54
7.4.90.0060.01216.56
7.4.80.0120.00619.39
7.4.70.0030.01316.61
7.4.60.0100.01016.47
7.4.50.0030.01216.59
7.4.40.0130.00316.33
7.4.00.0000.01515.05
7.3.330.0060.00013.15
7.3.320.0030.00313.13
7.3.310.0070.00016.13
7.3.300.0070.00016.28
7.3.290.0030.00316.32
7.3.280.0100.00816.28
7.3.260.0100.00616.31
7.3.240.0080.00816.38
7.3.230.0120.00616.14
7.3.210.0090.00916.60
7.3.200.0040.01216.27
7.3.190.0140.00916.40
7.3.180.0080.01216.22
7.3.170.0110.01116.36
7.3.160.0120.00416.27
7.3.10.0800.01314.75
7.3.00.6060.01014.60
7.2.330.0160.00616.65
7.2.320.0120.00616.20
7.2.310.0100.01016.50
7.2.300.0030.01316.47
7.2.290.0130.00416.46
7.2.130.3850.00714.81
7.2.120.2490.00714.89
7.2.110.3190.00714.70
7.2.100.3480.01314.84
7.2.90.3620.00715.04
7.2.80.3670.00714.97
7.2.70.3390.00314.79
7.2.60.3620.01014.98
7.2.50.4030.00714.56
7.2.40.3170.00314.32
7.2.30.1220.00314.96
7.2.20.4080.00314.92
7.2.10.3460.00714.94
7.2.00.3430.00714.70
7.1.250.2720.01013.29

preferences:
56.63 ms | 400 KiB | 5 Q