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; var_dump($encrypted); // Explode the string using the `:` separator. $parts = explode(':', $encrypted); var_dump("COUNT: " . count($parts)); // 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.130.0030.00718.43
8.3.120.0210.00217.88
8.3.110.0050.00320.94
8.3.100.0100.00016.66
8.3.90.0210.00626.77
8.3.80.0230.00721.75
8.3.70.0260.00822.60
8.3.60.0290.01124.21
8.3.50.0200.00824.20
8.3.40.0310.00723.80
8.3.30.0230.01023.65
8.3.20.0190.00623.45
8.3.10.0170.00823.99
8.3.00.0170.00823.88
8.2.250.0040.00418.66
8.2.240.0000.00817.25
8.2.230.0060.00322.58
8.2.220.0050.00324.06
8.2.210.0090.00826.77
8.2.200.0090.00521.88
8.2.190.0170.00721.67
8.2.180.0240.00426.20
8.2.170.0220.00525.22
8.2.160.0200.00724.02
8.2.150.0210.00723.63
8.2.140.0140.01124.14
8.2.130.0160.00625.03
8.2.120.0160.00723.96
8.2.110.0130.00922.60
8.2.100.0150.00822.61
8.2.90.0180.00522.76
8.2.80.0180.00722.62
8.2.70.0140.00746.58
8.2.60.0170.00522.11
8.2.50.0150.00521.75
8.2.40.0150.00621.95
8.2.30.0130.00521.38
8.2.20.0120.00721.19
8.2.10.0140.00720.80
8.2.00.0130.00520.79
8.1.300.0110.00720.00
8.1.290.0190.00828.80
8.1.280.0280.00726.20
8.1.270.0190.00424.15
8.1.260.0150.00725.47
8.1.250.0200.00525.85
8.1.240.0160.00723.56
8.1.230.0150.00722.66
8.1.220.0180.00622.71
8.1.210.0150.00822.66
8.1.200.0130.00821.99
8.1.190.0160.00622.00
8.1.180.0140.00621.79
8.1.170.0130.00821.84
8.1.160.0150.00521.77
8.1.150.0160.00421.08
8.1.140.0110.00620.81
8.1.130.0110.00620.64
8.1.120.0110.00620.35
8.1.110.0140.00520.66
8.1.100.0140.00520.64
8.1.90.0130.00520.67
8.1.80.0110.00620.38
8.1.70.0130.00420.38
8.1.60.0120.00720.43
8.1.50.0150.00420.45
8.1.40.0120.00620.07
8.1.30.0140.00520.48
8.1.20.0150.00420.47
8.1.10.0140.00720.45
8.1.00.0120.00519.49
8.0.300.0160.00422.57
8.0.290.0180.00221.79
8.0.280.0150.00521.34
8.0.270.0140.00420.51
8.0.260.0140.00420.43
8.0.250.0120.00520.25
8.0.240.0130.00520.46
8.0.230.0130.00520.49
8.0.220.0140.00520.44
8.0.210.0120.00720.18
8.0.200.0100.00719.40
8.0.190.0150.00520.19
8.0.180.0150.00520.20
8.0.170.0160.00520.19
8.0.160.0130.00519.74
8.0.150.0140.00420.18
8.0.140.0140.00620.16
8.0.130.0130.00419.89
8.0.120.0130.00620.16
8.0.110.0130.00520.16
8.0.100.0130.00519.54
8.0.90.0130.00519.94
8.0.80.0150.00419.93
8.0.70.0120.00519.93
8.0.60.0130.00419.94
8.0.50.0130.00419.91
8.0.30.0110.00718.93
8.0.20.0110.00818.75
8.0.10.0130.00818.74
8.0.00.0130.00718.38
7.4.330.0150.00423.41
7.4.320.0130.00619.81
7.4.300.0130.00518.78
7.4.290.0160.00420.08
7.4.280.0120.00518.70
7.4.270.0160.00419.59
7.4.260.0140.00519.58
7.4.250.0160.00420.10
7.4.240.0110.00418.71
7.4.230.0120.00519.36
7.4.220.0120.00519.08
7.4.210.0150.00519.51
7.4.200.0110.00619.36
7.4.190.0150.00520.08
7.4.180.0140.00720.10
7.4.160.0150.00419.09
7.4.150.0120.00718.60
7.4.140.0130.00618.30
7.4.130.0140.00718.05
7.4.120.0130.00818.02
7.4.110.0140.00818.06
7.4.100.0130.00817.93
7.4.90.0140.00717.89
7.4.80.0130.00817.80
7.4.70.0130.00817.66
7.4.60.0130.00717.58
7.4.50.0120.00917.54
7.4.40.0120.00817.47
7.4.30.0110.00817.46
7.4.20.0130.00717.51
7.4.10.0130.00817.43
7.4.00.0120.00817.33
7.3.330.0150.00619.42
7.3.320.0160.00519.77
7.3.310.0160.00419.93
7.3.300.0140.00519.76
7.3.290.0140.00519.71
7.3.280.0120.00718.93
7.3.270.0130.00718.56
7.3.260.0150.00618.22
7.3.250.0120.00917.95
7.3.240.0140.00718.04
7.3.230.0130.00817.98
7.3.220.0140.00717.87
7.3.210.0140.00717.80
7.3.200.0130.00817.68
7.3.190.0130.00817.52
7.3.180.0130.00817.47
7.3.170.0140.00817.44
7.3.160.0120.00817.43
7.3.150.0130.00817.38
7.3.140.0130.00817.39
7.3.130.0140.00717.36
7.3.120.0120.00817.22
7.3.110.0130.00817.15
7.3.100.0120.00816.97
7.3.90.0110.00917.00
7.3.80.0130.00716.95
7.3.70.0120.00816.94
7.3.60.0120.00916.94
7.3.50.0110.00816.92
7.3.40.0110.00816.89
7.3.30.0120.00816.85
7.3.20.0220.00717.02
7.3.10.0170.00817.00
7.3.00.0180.00817.01
7.2.340.0180.00718.06
7.2.330.0180.00817.83
7.2.320.0190.00717.76
7.2.310.0160.00917.54
7.2.300.0170.00917.54
7.2.290.0160.00817.48
7.2.280.0150.00917.45
7.2.270.0170.00817.46
7.2.260.0140.00917.40
7.2.250.0150.00917.27
7.2.240.0150.00817.20
7.2.230.0150.00817.01
7.2.220.0130.00917.05
7.2.210.0140.00816.97
7.2.200.0150.00817.05
7.2.190.0150.00917.01
7.2.180.0130.00917.00
7.2.170.0140.00916.98
7.2.160.0140.00816.96
7.2.150.0200.00817.13
7.2.140.0180.00917.15
7.2.130.0200.00817.20
7.2.120.0180.00817.15
7.2.110.0190.00817.12
7.2.100.0180.00817.15
7.2.90.0210.00917.14
7.2.80.0210.00917.14
7.2.70.0190.00817.13
7.2.60.0190.00817.17
7.2.50.0200.00817.17
7.2.40.0190.00917.17
7.2.30.0190.00917.19
7.2.20.0180.00817.17
7.2.10.0190.00917.17
7.2.00.0190.00917.18
7.1.330.0200.00818.75
7.1.320.0220.00816.40
7.1.310.0190.00816.31
7.1.300.0200.00816.33
7.1.290.0180.00716.32
7.1.280.0170.00816.33
7.1.270.0180.00816.29
7.1.260.0180.00916.29
7.1.250.0250.00916.23
7.1.240.0230.00816.25
7.1.230.0210.00916.28
7.1.220.0250.00816.25
7.1.210.0220.00916.26
7.1.200.0230.00816.22
7.1.190.0200.00816.25
7.1.180.0190.00816.27
7.1.170.0190.00816.23
7.1.160.0230.00716.24
7.1.150.0220.00816.24
7.1.140.0210.00816.24
7.1.130.0210.00816.23
7.1.120.0210.00816.25
7.1.110.0220.00816.29
7.1.100.0230.00716.26
7.1.90.0240.00816.29
7.1.80.0200.00816.27
7.1.70.0200.00816.27
7.1.60.0240.00716.28
7.1.50.0190.00816.25
7.1.40.0180.00816.29
7.1.30.0190.00816.31
7.1.20.0180.00916.33
7.1.10.0180.00816.28
7.1.00.0230.00816.24
7.0.330.0230.00716.08
7.0.320.0210.00716.08
7.0.310.0240.00716.04
7.0.300.0220.00716.08
7.0.290.0200.00716.06
7.0.280.0210.00716.06
7.0.270.0220.00816.05
7.0.260.0210.00716.07
7.0.250.0210.00816.09
7.0.240.0210.00716.12
7.0.230.0190.00816.11
7.0.220.0200.00916.13
7.0.210.0200.00816.09
7.0.200.0190.00816.10
7.0.190.0200.00816.10
7.0.180.0200.00816.11
7.0.170.0190.00716.13
7.0.160.0200.00816.11
7.0.150.0190.00716.09
7.0.140.0190.00716.07
7.0.130.0180.00716.08
7.0.120.0180.00816.11
7.0.110.0200.00816.09
7.0.100.0190.00716.07
7.0.90.0170.00816.06
7.0.80.0260.00816.08
7.0.70.0190.00716.11
7.0.60.0210.00816.05
7.0.50.0180.00716.08
7.0.40.0210.00716.09
7.0.30.0180.00816.07
7.0.20.0200.00716.04
7.0.10.0190.00816.08
7.0.00.0210.00816.13
5.6.400.0160.00816.54
5.6.390.0180.00816.49
5.6.380.0160.01016.42
5.6.370.0170.00916.43
5.6.360.0160.00916.45
5.6.350.0160.00916.41
5.6.340.0160.01016.44
5.6.330.0150.01016.41
5.6.320.0170.00916.45
5.6.310.0160.01016.42
5.6.300.0170.00816.42
5.6.290.0160.00916.44
5.6.280.0160.00916.44
5.6.270.0160.00916.46
5.6.260.0160.00916.43
5.6.250.0160.00916.40
5.6.240.0160.00916.43
5.6.230.0170.00916.44
5.6.220.0160.00916.40
5.6.210.0150.01016.38
5.6.200.0160.01016.41
5.6.190.0160.00916.39
5.6.180.0160.00816.38
5.6.170.0160.00916.40
5.6.160.0160.00916.41
5.6.150.0160.00916.39
5.6.140.0160.00816.38
5.6.130.0160.00916.37
5.6.120.0160.00916.39
5.6.110.0160.00916.34
5.6.100.0150.01016.40
5.6.90.0170.00916.37
5.6.80.0160.00816.32
5.6.70.0150.01016.35
5.6.60.0160.00916.34
5.6.50.0150.00916.34
5.6.40.0150.00916.33
5.6.30.0150.00916.34
5.6.20.0160.00816.35
5.6.10.0150.00916.33
5.6.00.0140.01016.32
5.5.380.0170.00916.33
5.5.370.0160.00916.33
5.5.360.0160.00916.30
5.5.350.0160.00916.18
5.5.340.0160.00916.18
5.5.330.0160.00916.23
5.5.320.0160.00916.21
5.5.310.0150.00916.21
5.5.300.0160.00916.22
5.5.290.0160.00916.19
5.5.280.0150.01016.21
5.5.270.0160.00916.21
5.5.260.0150.01016.24
5.5.250.0160.00916.18
5.5.240.0150.01016.18
5.5.230.0170.00816.17
5.5.220.0160.00916.15
5.5.210.0150.00916.20
5.5.200.0160.00916.17
5.5.190.0150.01016.16
5.5.180.0160.00916.15
5.5.170.0150.01016.21
5.5.160.0150.00916.17
5.5.150.0150.00916.16
5.5.140.0140.01016.15
5.5.130.0170.00816.14
5.5.120.0150.00916.14
5.5.110.0150.01016.15
5.5.100.0160.00816.18
5.5.90.0150.00916.16
5.5.80.0150.00916.17
5.5.70.0160.00916.15
5.5.60.0160.00916.14
5.5.50.0160.00916.15
5.5.40.0160.00816.15
5.5.30.0160.00916.15
5.5.20.0160.00916.17
5.5.10.0160.00916.12
5.5.00.0170.00916.10

preferences:
17.2 ms | 403 KiB | 5 Q