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); echo $key; echo $iv; 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.70.0100.01316.59
8.3.60.0000.01516.50
8.3.50.0070.00716.33
8.3.40.0120.00318.87
8.3.30.0110.00418.84
8.3.20.0000.00820.34
8.3.10.0050.00322.05
8.3.00.0040.00423.58
8.2.180.0150.00616.63
8.2.170.0110.00422.96
8.2.160.0070.00720.52
8.2.150.0070.00025.66
8.2.140.0030.00624.66
8.2.130.0040.00420.35
8.2.120.0070.00026.35
8.2.110.0030.00620.98
8.2.100.0090.00317.78
8.2.90.0030.00718.83
8.2.80.0080.00017.97
8.2.70.0030.00617.38
8.2.60.0040.00418.05
8.2.50.0030.00518.07
8.2.40.0080.00018.10
8.2.30.0040.00418.05
8.2.20.0040.00417.97
8.2.10.0040.00418.08
8.2.00.0070.00017.97
8.1.280.0150.00425.92
8.1.270.0040.00423.91
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00722.74
8.1.230.0040.00718.99
8.1.220.0030.00517.74
8.1.210.0030.00518.77
8.1.200.0080.00017.23
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0050.00318.53
8.1.160.0070.00018.87
8.1.150.0030.00520.12
8.1.140.0040.00417.25
8.1.130.0000.00718.90
8.1.120.0040.00417.47
8.1.110.0000.00717.39
8.1.100.0040.00417.40
8.1.90.0080.00017.38
8.1.80.0050.00317.27
8.1.70.0000.01117.41
8.1.60.0040.00417.51
8.1.50.0030.00617.45
8.1.40.0020.00517.36
8.1.30.0050.00317.66
8.1.20.0030.00617.61
8.1.10.0080.00017.41
8.1.00.0050.00317.47
8.0.300.0050.00318.77
8.0.290.0000.00816.75
8.0.280.0080.00018.32
8.0.270.0040.00417.28
8.0.260.0080.00018.52
8.0.250.0070.00017.03
8.0.240.0030.00317.01
8.0.230.0050.00217.04
8.0.220.0040.00416.86
8.0.210.0070.00016.85
8.0.200.0030.00317.01
8.0.190.0080.00016.89
8.0.180.0000.00716.99
8.0.170.0000.00916.82
8.0.160.0080.00416.97
8.0.150.0070.00016.81
8.0.140.0030.00616.98
8.0.130.0030.00313.34
8.0.120.0040.00416.82
8.0.110.0040.00416.87
8.0.100.0050.00316.87
8.0.90.0000.00817.03
8.0.80.0060.00916.93
8.0.70.0050.00216.75
8.0.60.0040.00416.87
8.0.50.0000.00716.86
8.0.30.0100.00717.06
8.0.20.0080.01217.40
8.0.10.0000.00716.84
8.0.00.0110.00716.89
7.4.330.0000.00415.55
7.4.320.0030.00316.61
7.4.300.0030.00316.62
7.4.290.0030.00316.49
7.4.280.0040.00416.64
7.4.270.0040.00416.61
7.4.260.0030.00316.45
7.4.250.0050.00316.48
7.4.240.0030.00316.59
7.4.230.0000.00816.60
7.4.220.0130.01016.40
7.4.210.0060.01516.63
7.4.200.0030.00316.50
7.4.160.0030.01816.65
7.4.150.0090.01217.40
7.4.140.0090.01017.86
7.4.130.0040.01716.49
7.4.120.0090.01016.58
7.4.110.0100.00716.37
7.4.100.0110.00616.62
7.4.90.0000.01616.45
7.4.80.0070.01119.39
7.4.70.0130.00616.37
7.4.60.0060.01016.48
7.4.50.0120.00316.38
7.4.40.0070.01016.73
7.4.30.0030.01216.46
7.4.00.0060.01215.05
7.3.330.0000.00513.30
7.3.320.0020.00213.16
7.3.310.0000.00816.33
7.3.300.0070.00016.32
7.3.290.0110.00616.33
7.3.280.0070.01116.29
7.3.270.0100.01017.40
7.3.260.0110.00616.41
7.3.250.0080.01016.37
7.3.240.0020.01416.36
7.3.230.0120.00616.45
7.3.210.0150.00916.40
7.3.200.0140.00316.33
7.3.190.0060.01016.38
7.3.180.0030.02016.30
7.3.170.0100.00616.51
7.3.160.0030.01616.47
7.3.120.0050.01014.85
7.3.110.0090.00814.91
7.3.100.0080.00814.70
7.3.90.0040.00914.68
7.3.80.0060.01014.77
7.3.70.0060.00814.73
7.3.60.0060.00914.74
7.3.50.0110.00614.68
7.3.40.0040.00614.61
7.3.30.0060.00914.78
7.3.20.0070.00916.70
7.3.10.0050.00816.64
7.3.00.0070.00916.63
7.2.330.0120.00616.68
7.2.320.0170.00616.73
7.2.310.0100.00716.63
7.2.300.0140.00416.59
7.2.290.0120.01216.41
7.2.250.0070.01214.97
7.2.240.0050.01314.83
7.2.230.0040.01215.08
7.2.220.0070.00914.94
7.2.210.0080.00814.92
7.2.200.0040.00814.93
7.2.190.0040.00914.86
7.2.180.0090.00714.94
7.2.170.0040.01214.88
7.2.160.0060.00914.70
7.2.150.0060.00516.82
7.2.140.0020.01216.92
7.2.130.0070.00816.78
7.2.120.0090.00916.85
7.2.110.0070.00416.86
7.2.100.0020.01316.82
7.2.90.0070.00916.87
7.2.80.0080.00617.00
7.2.70.0060.01016.81
7.2.60.0050.00916.86
7.2.50.0090.00616.90
7.2.40.0070.00816.94
7.2.30.0040.01116.63
7.2.20.0040.00916.78
7.2.10.0080.00516.75
7.2.00.0080.00716.86
7.1.330.0030.01215.66
7.1.320.0060.00815.67
7.1.310.0050.01015.74
7.1.300.0090.00315.56
7.1.290.0020.01215.69
7.1.280.0030.01115.65
7.1.270.0050.00915.69
7.1.260.0050.01015.57
7.1.250.0060.01015.70
7.1.240.0080.00415.65
7.1.230.0060.00915.67
7.1.220.0070.00715.69
7.1.210.0030.01015.73
7.1.200.0130.00315.62
7.1.190.0040.00815.68
7.1.180.0140.00315.63
7.1.170.0060.00615.62
7.1.160.0070.00415.68
7.1.150.0000.01315.61
7.1.140.0080.00415.50
7.1.130.0030.00715.76
7.1.120.0080.00415.73
7.1.110.0000.01115.79
7.1.100.0850.00915.97
7.1.90.0250.01016.25
7.1.80.0470.01016.14
7.1.70.0520.00615.52
7.1.60.0700.01229.02
7.1.50.0230.01328.70
7.1.40.0720.01228.50
7.1.30.0220.00828.62
7.1.20.1390.01028.56
7.1.10.0110.00714.95
7.1.00.0140.01115.06
7.0.330.0050.00515.35
7.0.320.0030.00615.06
7.0.310.0060.00915.13
7.0.300.0030.01015.37
7.0.290.0000.01015.46
7.0.280.0140.00015.53
7.0.270.0100.00315.20
7.0.260.0030.01015.14
7.0.250.0060.01015.33
7.0.240.0610.01115.78
7.0.230.0110.00915.71
7.0.220.0820.00915.77
7.0.210.0580.01314.99
7.0.200.0140.01315.08
7.0.190.0120.00914.90
7.0.180.0120.00814.67
7.0.170.0150.01214.59
7.0.160.0370.00914.65
7.0.150.0160.00914.73
7.0.140.0590.01314.73
7.0.130.0100.01114.90
7.0.120.0140.01114.91
7.0.110.0140.01014.81
7.0.100.0100.01214.77
7.0.90.0770.01114.72
7.0.80.0130.00714.83
7.0.70.0160.00514.76
7.0.60.0760.00914.72
7.0.50.0090.01114.86
7.0.40.0180.00914.38
7.0.30.0560.01014.43
7.0.20.0100.00814.34
7.0.10.0650.00714.44
7.0.00.0170.00814.46
5.6.400.0030.01014.38
5.6.390.0030.00714.43
5.6.380.0100.00314.73
5.6.370.0090.00314.46
5.6.360.0070.00714.68
5.6.350.0090.00614.50
5.6.340.0060.00914.39
5.6.330.0030.01014.30
5.6.320.0060.01014.55
5.6.310.0080.00814.58
5.6.300.0070.00713.96
5.6.290.0000.01214.27
5.6.280.0050.00313.88
5.6.270.0000.01514.07
5.6.260.0080.00814.27
5.6.250.0110.00414.38
5.6.240.0060.00914.59
5.6.230.0070.00714.29
5.6.220.0030.01014.39
5.6.210.0070.01014.20
5.6.200.0000.01914.21
5.6.190.0090.00914.35
5.6.180.0030.01414.14
5.6.170.0100.00714.30
5.6.160.0030.01014.21
5.6.150.0060.00914.45
5.6.140.0000.01414.10
5.6.130.0000.01514.27
5.6.120.0030.01414.53
5.6.110.0090.00614.07
5.6.100.0130.00014.07
5.6.90.0060.00314.60
5.6.80.0030.00514.07
5.6.70.0030.00914.32
5.6.60.0110.00713.99
5.6.50.0030.01514.30
5.6.40.0120.00314.13
5.6.30.0000.01814.30
5.6.20.0030.01414.19
5.6.10.0000.01114.14
5.6.00.0060.00614.27

preferences:
57.78 ms | 401 KiB | 5 Q