3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt_decrypt($action, $string, $secret_key, $secret_iv) { $output = false; if (!extension_loaded('openssl')) { return $string; } $encrypt_method = "AES-256-CBC"; // hash $key = hash('sha256', $secret_key); // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning $iv = substr(hash('sha256', $secret_iv), 0, 16); if($action == 'encrypt') { $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv); $output = base64_encode($output); } else if($action == 'decrypt'){ $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv); } return $output; } echo encrypt_decrypt('decrypt', 'NElmZ1VlbnhCOXQ4eVlPelI2YWtQbm9MWlZSeU5jV1VZSFJhY0NHc2dSWT0=', ENCRYPTION_KEY, ENCRYPTION_VI);

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.40.0070.00719.02
8.3.30.0090.00618.85
8.3.20.0080.00020.16
8.3.10.0060.00321.79
8.3.00.0040.00423.66
8.2.170.0040.01118.91
8.2.160.0080.00522.96
8.2.150.0000.01125.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.11
8.2.110.0100.00022.07
8.2.100.0090.00317.91
8.2.90.0070.00018.16
8.2.80.0050.00317.97
8.2.70.0060.00617.50
8.2.60.0040.00419.32
8.2.50.0000.00718.10
8.2.40.0040.00422.32
8.2.30.0080.00019.26
8.2.20.0000.00717.93
8.2.10.0040.00418.04
8.2.00.0000.00717.98
8.1.270.0040.00423.98
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00323.97
8.1.230.0000.01120.93
8.1.220.0040.00417.74
8.1.210.0070.00318.77
8.1.200.0090.00017.13
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00318.52
8.1.160.0020.00518.88
8.1.150.0070.00020.18
8.1.140.0040.00417.43
8.1.130.0040.00418.92
8.1.120.0030.00317.29
8.1.110.0040.00417.29
8.1.100.0040.00417.43
8.1.90.0050.00317.29
8.1.80.0050.00217.42
8.1.70.0070.00317.29
8.1.60.0040.00417.49
8.1.50.0030.00617.49
8.1.40.0040.00417.45
8.1.30.0060.00317.54
8.1.20.0090.00017.59
8.1.10.0060.00317.44
8.1.00.0000.00817.45
8.0.300.0040.00422.07
8.0.290.0040.00416.75
8.0.280.0050.00218.37
8.0.270.0100.00017.30
8.0.260.0000.00718.45
8.0.250.0000.00717.00
8.0.240.0070.00016.91
8.0.230.0030.00316.97
8.0.220.0100.00017.00
8.0.210.0030.00316.93
8.0.200.0060.00017.04
8.0.190.0030.00617.02
8.0.180.0040.00416.98
8.0.170.0040.00716.86
8.0.160.0030.00716.95
8.0.150.0000.00816.85
8.0.140.0040.00416.93
8.0.130.0000.00513.35
8.0.120.0040.00416.91
8.0.110.0000.00816.98
8.0.100.0030.00516.90
8.0.90.0040.00416.87
8.0.80.0110.00417.01
8.0.70.0040.00417.02
8.0.60.0030.00616.79
8.0.50.0040.00416.95
8.0.30.0080.01017.03
8.0.20.0130.00717.40
8.0.10.0040.00417.08
8.0.00.0030.01416.84
7.4.330.0000.00415.55
7.4.320.0030.00316.53
7.4.300.0000.00616.60
7.4.290.0040.00416.60
7.4.280.0060.00316.50
7.4.270.0000.00716.51
7.4.260.0040.00416.49
7.4.250.0040.00416.46
7.4.240.0000.00716.51
7.4.230.0030.00316.69
7.4.220.0160.00316.67
7.4.210.0120.00616.49
7.4.200.0000.00716.44
7.4.160.0110.00916.47
7.4.150.0070.01117.40
7.4.140.0130.00717.86
7.4.130.0110.00716.71
7.4.120.0140.00716.50
7.4.110.0110.00616.63
7.4.100.0100.00716.57
7.4.90.0070.01016.32
7.4.80.0060.01419.39
7.4.70.0060.01116.54
7.4.60.0110.00916.44
7.4.50.0090.01116.51
7.4.40.0170.00416.34
7.4.30.0160.00316.11
7.4.20.0110.01016.46
7.4.10.0140.01716.27
7.4.00.0030.01415.54
7.3.330.0030.00313.30
7.3.320.0060.00013.26
7.3.310.0060.00316.19
7.3.300.0020.00516.31
7.3.290.0040.00416.16
7.3.280.0070.01016.28
7.3.270.0170.00017.40
7.3.260.0140.00416.38
7.3.250.0090.00816.44
7.3.240.0110.00716.35
7.3.230.0100.00716.43
7.3.210.0120.00916.27
7.3.200.0030.01316.49
7.3.190.0170.00616.43
7.3.180.0140.00416.42
7.3.170.0090.01216.33
7.3.160.0180.00316.30
7.3.150.0080.01116.21
7.3.140.0120.01516.38
7.3.130.0130.00816.31
7.3.120.0120.00716.11
7.3.110.0080.00916.09
7.3.100.0090.00716.10
7.3.90.0040.01016.15
7.3.80.0090.00916.06
7.3.70.0090.00616.07
7.3.60.0110.00616.04
7.3.50.0060.01116.01
7.3.40.0030.01316.09
7.3.30.0050.01016.06
7.3.20.0090.00916.57
7.3.10.0110.00516.64
7.3.00.0020.01216.66
7.2.330.0040.01516.42
7.2.320.0060.01316.74
7.2.310.0120.00516.69
7.2.300.0070.01216.64
7.2.290.0110.00816.36
7.2.280.0200.00316.63
7.2.270.0090.01216.26
7.2.260.0070.01416.64
7.2.250.0000.01916.51
7.2.240.0070.01116.25
7.2.230.0100.00716.12
7.2.220.0070.01216.21
7.2.210.0080.01016.23
7.2.200.0060.00816.24
7.2.190.0080.01016.22
7.2.180.0040.01216.23
7.2.170.0060.00916.20
7.2.160.0090.00916.08
7.2.150.0080.00716.88
7.2.140.0060.01116.90
7.2.130.0060.01216.84
7.2.120.0080.00716.72
7.2.110.0080.00916.75
7.2.100.0030.01316.78
7.2.90.0090.00716.93
7.2.80.0090.00816.80
7.2.70.0060.01116.83
7.2.60.0040.01016.93
7.2.50.0110.00716.83
7.2.40.0130.00716.88
7.2.30.0120.00916.80
7.2.20.0110.00916.82
7.2.10.0110.01016.90
7.2.00.0060.01016.87
7.1.330.0100.01016.21
7.1.320.0120.00716.16
7.1.310.0090.00916.13
7.1.300.0130.00416.18
7.1.290.0100.00716.18
7.1.280.0080.01116.10
7.1.270.0090.01216.09
7.1.260.0070.01016.14
7.1.250.0140.00716.16
7.1.240.0240.00915.49
7.1.230.0360.01315.47
7.1.220.0240.00515.38
7.1.210.0160.01015.53
7.1.200.0140.00815.53
7.1.190.0290.01015.35
7.1.180.0170.01715.31
7.1.170.0230.00915.48
7.1.160.0200.01015.56
7.1.150.0330.00015.44
7.1.140.0250.00615.39
7.1.130.0260.00315.58
7.1.120.0160.01215.38
7.1.110.0230.00815.57
7.1.100.1030.01715.94
7.1.90.1140.01015.85
7.1.80.0750.00915.98
7.1.70.0690.01315.45
7.1.60.1130.01127.44
7.1.50.1290.01327.09
7.1.40.1030.01427.07
7.1.30.0780.01327.06
7.1.20.1180.01327.00
7.1.10.2200.01014.97
7.1.00.1760.01015.09
7.0.330.0180.01115.38
7.0.320.0290.00015.20
7.0.310.0210.00815.18
7.0.300.0230.00915.20
7.0.290.0140.01415.12
7.0.280.0270.00415.15
7.0.270.0290.00015.07
7.0.260.0250.00415.33
7.0.250.0210.01315.43
7.0.240.1190.01215.71
7.0.230.1050.01115.68
7.0.220.1080.00515.72
7.0.210.0700.01215.03
7.0.200.2320.01015.15
7.0.190.1160.01114.98
7.0.180.1030.01014.69
7.0.170.1230.01214.79
7.0.160.1320.01114.83
7.0.150.1820.00814.71
7.0.140.1670.00614.72
7.0.130.0620.01015.06
7.0.120.0870.01014.81
7.0.110.0880.00714.69
7.0.100.0890.00614.71
7.0.90.0650.00914.63
7.0.80.0830.00914.78
7.0.70.0880.00814.88
7.0.60.0820.00814.60
7.0.50.0830.00914.73
7.0.40.1260.01114.92
7.0.30.0900.01114.86
7.0.20.1840.00814.89
7.0.10.1790.00914.86
7.0.00.1780.00915.03
5.6.400.0210.01415.79
5.6.390.0180.01115.96
5.6.380.0200.01115.59
5.6.370.0200.01116.15
5.6.360.0170.01515.91
5.6.350.0220.00715.52
5.6.340.0220.00916.06
5.6.330.0150.01315.65
5.6.320.0220.01115.66
5.6.310.0210.00615.77
5.6.300.0200.03619.12
5.6.290.0160.04219.19
5.6.280.0170.04119.33
5.6.270.0150.04219.22
5.6.260.0210.03819.19
5.6.250.0200.04719.35
5.6.240.0160.05419.22
5.6.230.0160.04619.32
5.6.220.0160.04419.18
5.6.210.0170.04119.14
5.6.200.0120.04419.15
5.6.190.0150.05019.21
5.6.180.0210.05119.14
5.6.170.0140.04319.23
5.6.160.0170.04319.35
5.6.150.0140.04519.12
5.6.140.0190.04419.28
5.6.130.0190.04619.28
5.6.120.0160.05519.24
5.6.110.0210.04719.28
5.6.100.0180.04919.26
5.6.90.0140.04419.27
5.6.80.0160.04218.86
5.6.70.0150.03918.86
5.6.60.0130.04318.80
5.6.50.0110.04318.83
5.6.40.0090.04518.63
5.6.30.0120.04918.86
5.6.20.0140.04718.77
5.6.10.0230.04118.83
5.6.00.0110.05018.76

preferences:
58.22 ms | 400 KiB | 5 Q