3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Set the method $method = 'AES-128-CBC'; // Set the encryption key $encryption_key = 'myencryptionkey'; // Generet a random initialisation vector $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($method)); // Define the date to be encrypted $data = "Encrypt me, please!"; var_dump("Before encryption: $data"); // Encrypt the data $encrypted = openssl_encrypt($data, $method, $encryption_key, 0, $iv); var_dump("Encrypted: ${encrypted}"); // Append the vector at the end of the encrypted string $encrypted = $encrypted . ':' . $iv; // Explode the string using the `:` separator. $parts = explode(':', $encrypted); // Decrypt the data $decrypted = openssl_decrypt($parts[0], $method, $encryption_key, 0, $parts[1]); var_dump("Decrypted: ${decrypted}");

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.110.0090.00020.94
8.3.100.0040.01124.06
8.3.90.0150.00326.77
8.3.80.0000.00916.75
8.3.70.0160.00316.58
8.3.60.0080.01116.75
8.3.50.0100.01021.87
8.3.40.0100.01018.84
8.3.30.0150.00018.82
8.3.20.0080.00019.13
8.3.10.0040.00421.73
8.3.00.0030.00520.77
8.2.230.0060.00322.58
8.2.220.0070.00337.54
8.2.210.0130.00626.77
8.2.200.0070.00316.75
8.2.190.0100.01016.88
8.2.180.0040.01116.50
8.2.170.0170.00722.96
8.2.160.0100.00320.35
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00820.39
8.2.120.0080.00026.35
8.2.110.0090.00721.74
8.2.100.0080.00417.54
8.2.90.0120.00618.06
8.2.80.0080.00017.97
8.2.70.0080.00417.56
8.2.60.0030.00517.56
8.2.50.0110.00217.34
8.2.40.0100.00318.29
8.2.30.0030.00518.39
8.2.20.0010.00617.61
8.2.10.0100.00417.73
8.2.00.0110.00317.72
8.1.290.0130.00825.64
8.1.280.0100.01025.92
8.1.270.0040.00423.96
8.1.260.0080.00028.09
8.1.250.0000.00728.09
8.1.240.0030.00619.12
8.1.230.0110.00020.84
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0070.00517.18
8.1.190.0090.00417.24
8.1.180.0100.00217.61
8.1.170.0100.00217.73
8.1.160.0060.00617.98
8.1.150.0100.00118.08
8.1.140.0080.00618.02
8.1.130.0080.00517.21
8.1.120.0090.00517.24
8.1.110.0090.00617.31
8.1.100.0080.00617.35
8.1.90.0110.00317.34
8.1.80.0110.00217.25
8.1.70.0100.00417.22
8.1.60.0100.00617.42
8.1.50.0130.00417.49
8.1.40.0120.00617.50
8.1.30.0130.00617.55
8.1.20.0130.00417.57
8.1.10.0100.00617.46
8.1.00.0100.00517.47
8.0.300.0060.00919.62
8.0.290.0040.00816.67
8.0.280.0020.01017.45
8.0.270.0120.00316.71
8.0.260.0070.00416.73
8.0.250.0070.00516.81
8.0.240.0040.00616.83
8.0.230.0070.00616.74
8.0.220.0050.00716.76
8.0.210.0070.00516.75
8.0.200.0060.00716.78
8.0.190.0080.00416.77
8.0.180.0080.00416.80
8.0.170.0080.00416.80
8.0.160.0080.00616.79
8.0.150.0110.00416.79
8.0.140.0100.00416.71
8.0.130.0110.00315.87
8.0.120.0110.00416.77
8.0.110.0100.00416.74
8.0.100.0080.00416.77
8.0.90.0120.00316.81
8.0.80.0120.00516.71
8.0.70.0110.00416.74
8.0.60.0130.00316.74
8.0.50.0090.00616.74
8.0.30.0130.00616.87
8.0.20.0120.00717.09
8.0.10.0090.00616.81
8.0.00.0110.00716.88
7.4.330.0040.00516.64
7.4.320.0090.00416.51
7.4.300.0080.00416.44
7.4.290.0100.00516.55
7.4.280.0120.00416.51
7.4.270.0080.00816.52
7.4.260.0050.00816.49
7.4.250.0120.00416.50
7.4.240.0110.00416.51
7.4.230.0090.00616.56
7.4.220.0130.00316.48
7.4.210.0090.00816.56
7.4.200.0110.00216.53
7.4.190.0100.00516.54
7.4.180.0110.00516.53
7.4.160.0140.00316.52
7.4.150.0100.00616.70
7.4.140.0120.00617.00
7.4.130.0140.00316.46
7.4.120.0130.00416.51
7.4.110.0110.00616.47
7.4.100.0110.00716.50
7.4.90.0130.00616.50
7.4.80.0100.00816.95
7.4.70.0100.00916.35
7.4.60.0120.00516.46
7.4.50.0100.00816.35
7.4.40.0120.00616.38
7.4.30.0090.00916.43
7.4.20.0130.00616.44
7.4.10.0100.00816.44
7.4.00.0080.01116.04
7.3.330.0080.00715.54
7.3.320.0140.00115.56
7.3.310.0100.00616.34
7.3.300.0090.00616.30
7.3.290.0100.00616.36
7.3.280.0110.00716.28
7.3.270.0140.00216.66
7.3.260.0140.00416.40
7.3.250.0110.00616.29
7.3.240.0080.00916.35
7.3.230.0100.00716.42
7.3.220.0130.00416.38
7.3.210.0160.00316.34
7.3.200.0120.00716.24
7.3.190.0140.00516.35
7.3.180.0120.00616.33
7.3.170.0130.00516.31
7.3.160.0120.00616.27
7.3.150.0110.00816.31
7.3.140.0140.00416.31
7.3.130.0130.00716.35
7.3.120.0120.00815.83
7.3.110.0110.00815.59
7.3.100.0120.00715.53
7.3.90.0110.00815.59
7.3.80.0110.00715.56
7.3.70.0110.00815.45
7.3.60.0100.00815.51
7.3.50.0110.00815.44
7.3.40.0090.00815.37
7.3.30.0100.00715.40
7.3.20.0140.00815.70
7.3.10.0160.00615.79
7.3.00.0150.00715.73
7.2.340.0120.00416.42
7.2.330.0130.00716.38
7.2.320.0120.00716.32
7.2.310.0140.00616.38
7.2.300.0110.00716.40
7.2.290.0130.00516.38
7.2.280.0130.00616.33
7.2.270.0130.00616.35
7.2.260.0130.00716.37
7.2.250.0090.01016.03
7.2.240.0110.00915.68
7.2.230.0120.00715.67
7.2.220.0120.00715.68
7.2.210.0100.00815.64
7.2.200.0120.00715.61
7.2.190.0110.00715.56
7.2.180.0120.00715.54
7.2.170.0120.00715.60
7.2.160.0100.00915.51
7.2.150.0170.00515.94
7.2.140.0160.00715.90
7.2.130.0160.00715.93
7.2.120.0160.00815.95
7.2.110.0190.00715.92
7.2.100.0150.00715.99
7.2.90.0160.00815.93
7.2.80.0180.00715.95
7.2.70.0150.00915.93
7.2.60.0130.00915.94
7.2.50.0170.00915.99
7.2.40.0150.00816.01
7.2.30.0170.00915.99
7.2.20.0130.01015.94
7.2.10.0180.00715.98
7.2.00.0150.00916.13
7.1.330.0150.00715.00
7.1.320.0160.00615.05
7.1.310.0110.00815.05
7.1.300.0130.00714.97
7.1.290.0150.00814.98
7.1.280.0140.00614.94
7.1.270.0150.00814.95
7.1.260.0100.00914.95
7.1.250.0170.00714.91
7.1.240.0190.00714.75
7.1.230.0190.00614.81
7.1.220.0190.00714.80
7.1.210.0220.00714.77
7.1.200.0200.00914.79
7.1.190.0170.00914.82
7.1.180.0200.00714.78
7.1.170.0170.00714.75
7.1.160.0180.00814.80
7.1.150.0190.00514.81
7.1.140.0260.00514.81
7.1.130.0170.00814.75
7.1.120.0210.00714.84
7.1.110.0170.00815.13
7.1.100.0180.00815.09
7.1.90.0200.00714.96
7.1.80.0200.00814.97
7.1.70.0230.00915.10
7.1.60.0220.00917.09
7.1.50.0190.00816.93
7.1.40.0210.00916.90
7.1.30.0230.00816.91
7.1.20.0190.00816.94
7.1.10.0170.00914.91
7.1.00.0180.01215.32
7.0.330.0210.00714.55
7.0.320.0190.00914.60
7.0.310.0230.00714.52
7.0.300.0240.00814.55
7.0.290.0220.00714.56
7.0.280.0190.00914.61
7.0.270.0210.00814.56
7.0.260.0240.00814.56
7.0.250.0270.00714.90
7.0.240.0190.00814.91
7.0.230.0220.00614.85
7.0.220.0240.00714.86
7.0.210.0210.00814.75
7.0.200.0190.00914.82
7.0.190.0210.00614.77
7.0.180.0210.00714.71
7.0.170.0230.01014.73
7.0.160.0190.00814.69
7.0.150.0190.00814.69
7.0.140.0200.00914.71
7.0.130.0200.00714.74
7.0.120.0200.00814.71
7.0.110.0200.00714.74
7.0.100.0180.00814.65
7.0.90.0190.00714.67
7.0.80.0210.00714.69
7.0.70.0190.00914.69
7.0.60.0220.01114.94
7.0.50.0230.01015.00
7.0.40.0230.01015.07
7.0.30.0230.01015.01
7.0.20.0230.01115.00
7.0.10.0220.01115.04
7.0.00.0260.00915.05
5.6.400.0130.00715.06
5.6.390.0110.00914.99
5.6.380.0130.00714.93
5.6.370.0140.00814.90
5.6.360.0130.00914.88
5.6.350.0130.00914.89
5.6.340.0130.00814.93
5.6.330.0130.00914.91
5.6.320.0140.00814.85
5.6.310.0110.01014.96
5.6.300.0150.01415.55
5.6.290.0130.01415.52
5.6.280.0130.01615.89
5.6.270.0140.01415.56
5.6.260.0140.01315.58
5.6.250.0140.01415.55
5.6.240.0120.01515.58
5.6.230.0150.01315.57
5.6.220.0140.01215.57
5.6.210.0180.01615.79
5.6.200.0160.01615.81
5.6.190.0180.01615.83
5.6.180.0180.01715.87
5.6.170.0210.01415.81
5.6.160.0160.01915.85
5.6.150.0160.01815.81
5.6.140.0150.01815.84
5.6.130.0200.01615.80
5.6.120.0190.01615.86
5.6.110.0190.01715.83
5.6.100.0170.01715.82
5.6.90.0170.01715.85
5.6.80.0170.01715.66
5.6.70.0170.01715.69
5.6.60.0170.01815.65
5.6.50.0160.01815.74
5.6.40.0190.01415.72
5.6.30.0200.01615.68
5.6.20.0200.01615.66
5.6.10.0200.01515.69
5.6.00.0210.01515.69
5.5.380.0130.01414.78
5.5.370.0140.01314.78
5.5.360.0110.01514.74
5.5.350.0170.01615.03
5.5.340.0180.01715.14
5.5.330.0170.01715.08
5.5.320.0170.01615.08
5.5.310.0180.01515.10
5.5.300.0180.01715.11
5.5.290.0190.01715.09
5.5.280.0140.01815.17
5.5.270.0160.01715.09
5.5.260.0180.01615.09
5.5.250.0200.01715.04
5.5.240.0170.01715.05
5.5.230.0180.01614.97
5.5.220.0180.01615.02
5.5.210.0190.01415.02
5.5.200.0180.01514.92
5.5.190.0170.01715.02
5.5.180.0180.01815.00
5.5.170.0130.00714.57
5.5.160.0190.01614.98
5.5.150.0170.01714.99
5.5.140.0180.01714.93
5.5.130.0180.01714.92
5.5.120.0170.01714.92
5.5.110.0180.01515.00
5.5.100.0190.01614.95
5.5.90.0180.01614.96
5.5.80.0200.01514.97
5.5.70.0200.01415.00
5.5.60.0160.01614.96
5.5.50.0190.01714.93
5.5.40.0170.01514.93
5.5.30.0180.01714.97
5.5.20.0180.01614.97
5.5.10.0180.01715.01
5.5.00.0180.01614.93

preferences:
27.26 ms | 403 KiB | 5 Q