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.60.0260.01123.57
8.3.50.0140.00623.35
8.3.40.0280.00922.32
8.3.30.0200.00922.62
8.3.20.0140.00722.62
8.3.10.0130.00823.30
8.3.00.0120.00923.30
8.2.180.0280.00325.92
8.2.170.0270.00424.44
8.2.160.0210.00823.11
8.2.150.0180.00722.59
8.2.140.0090.01023.49
8.2.130.0110.00724.68
8.2.120.0130.00623.40
8.2.110.0120.00822.14
8.2.100.0130.00821.92
8.2.90.0170.00522.10
8.2.80.0160.00621.93
8.2.70.0120.00748.11
8.2.60.0150.00521.45
8.2.50.0150.00521.12
8.2.40.0150.00621.35
8.2.30.0130.00520.78
8.2.20.0100.00720.63
8.2.10.0110.00720.26
8.2.00.0120.00420.25
8.1.280.0250.00725.92
8.1.270.0140.00423.49
8.1.260.0100.00725.21
8.1.250.0160.00525.66
8.1.240.0130.00722.92
8.1.230.0120.00721.98
8.1.220.0150.00722.03
8.1.210.0140.00721.98
8.1.200.0100.00821.31
8.1.190.0140.00521.32
8.1.180.0130.00621.17
8.1.170.0120.00721.22
8.1.160.0130.00521.22
8.1.150.0140.00420.52
8.1.140.0090.00620.27
8.1.130.0100.00620.09
8.1.120.0100.00619.86
8.1.110.0130.00420.10
8.1.100.0130.00520.08
8.1.90.0130.00420.11
8.1.80.0110.00619.85
8.1.70.0120.00419.85
8.1.60.0110.00719.90
8.1.50.0140.00419.92
8.1.40.0110.00619.59
8.1.30.0140.00419.96
8.1.20.0150.00419.95
8.1.10.0120.00619.92
8.1.00.0100.00519.08
8.0.300.0140.00321.88
8.0.290.0160.00321.08
8.0.280.0140.00420.73
8.0.270.0130.00419.94
8.0.260.0130.00419.85
8.0.250.0110.00519.75
8.0.240.0120.00519.89
8.0.230.0110.00519.92
8.0.220.0120.00419.87
8.0.210.0110.00619.63
8.0.200.0090.00718.94
8.0.190.0140.00519.64
8.0.180.0130.00519.66
8.0.170.0140.00419.64
8.0.160.0120.00419.24
8.0.150.0130.00419.63
8.0.140.0130.00519.61
8.0.130.0120.00419.32
8.0.120.0110.00619.61
8.0.110.0130.00519.61
8.0.100.0120.00519.06
8.0.90.0120.00519.41
8.0.80.0130.00419.40
8.0.70.0110.00519.41
8.0.60.0120.00419.42
8.0.50.0120.00419.38
8.0.30.0110.00618.54
8.0.20.0100.00818.40
8.0.10.0120.00818.39
8.0.00.0130.00718.12
7.4.330.0140.00319.85
7.4.320.0120.00619.28
7.4.300.0110.00418.51
7.4.290.0150.00419.52
7.4.280.0120.00518.30
7.4.270.0150.00419.08
7.4.260.0130.00419.06
7.4.250.0160.00319.54
7.4.240.0100.00418.31
7.4.230.0110.00618.86
7.4.220.0120.00518.63
7.4.210.0140.00519.03
7.4.200.0110.00618.90
7.4.190.0140.00519.53
7.4.180.0120.00619.54
7.4.160.0140.00418.64
7.4.150.0110.00818.21
7.4.140.0120.00617.99
7.4.130.0140.00717.78
7.4.120.0130.00817.76
7.4.110.0140.00817.78
7.4.100.0130.00817.68
7.4.90.0140.00717.64
7.4.80.0130.00817.56
7.4.70.0130.00817.45
7.4.60.0130.00717.38
7.4.50.0120.00917.34
7.4.40.0120.00817.28
7.4.30.0110.00917.28
7.4.20.0130.00717.32
7.4.10.0120.00817.25
7.4.00.0120.00817.16
7.3.330.0140.00618.96
7.3.320.0160.00519.18
7.3.310.0170.00319.37
7.3.300.0140.00519.22
7.3.290.0130.00419.17
7.3.280.0110.00718.47
7.3.270.0120.00718.17
7.3.260.0150.00617.92
7.3.250.0120.00817.68
7.3.240.0140.00717.76
7.3.230.0130.00817.70
7.3.220.0140.00717.61
7.3.210.0140.00717.55
7.3.200.0130.00817.44
7.3.190.0130.00817.30
7.3.180.0130.00817.26
7.3.170.0140.00817.24
7.3.160.0120.00817.24
7.3.150.0130.00817.19
7.3.140.0130.00817.20
7.3.130.0140.00717.17
7.3.120.0120.00817.04
7.3.110.0130.00816.97
7.3.100.0120.00816.80
7.3.90.0110.00916.84
7.3.80.0120.00716.79
7.3.70.0120.00816.78
7.3.60.0110.00916.78
7.3.50.0110.00816.76
7.3.40.0110.00816.73
7.3.30.0110.00816.69
7.3.20.0210.00716.86
7.3.10.0170.00816.85
7.3.00.0180.00816.85
7.2.340.0180.00717.78
7.2.330.0180.00817.58
7.2.320.0190.00717.52
7.2.310.0160.00917.34
7.2.300.0160.00917.34
7.2.290.0160.00817.28
7.2.280.0150.00917.26
7.2.270.0170.00817.27
7.2.260.0140.00917.22
7.2.250.0150.00917.09
7.2.240.0140.00917.03
7.2.230.0150.00816.85
7.2.220.0130.00916.89
7.2.210.0140.00816.81
7.2.200.0150.00816.89
7.2.190.0140.00916.85
7.2.180.0130.00916.84
7.2.170.0140.00916.82
7.2.160.0140.00816.80
7.2.150.0200.00816.97
7.2.140.0180.00916.99
7.2.130.0200.00817.05
7.2.120.0180.00817.00
7.2.110.0190.00816.97
7.2.100.0180.00816.99
7.2.90.0210.00916.99
7.2.80.0210.00916.98
7.2.70.0190.00816.97
7.2.60.0190.00817.02
7.2.50.0200.00817.02
7.2.40.0190.00917.02
7.2.30.0190.00917.04
7.2.20.0180.00917.02
7.2.10.0180.00917.01
7.2.00.0190.00917.02
7.1.330.0200.00818.61
7.1.320.0220.00816.23
7.1.310.0190.00816.14
7.1.300.0200.00816.16
7.1.290.0170.00716.15
7.1.280.0170.00816.16
7.1.270.0180.00816.12
7.1.260.0180.00816.12
7.1.250.0250.00916.06
7.1.240.0230.00816.08
7.1.230.0210.00916.11
7.1.220.0250.00816.08
7.1.210.0220.00916.09
7.1.200.0230.00816.05
7.1.190.0200.00816.08
7.1.180.0200.00816.10
7.1.170.0190.00916.06
7.1.160.0230.00716.07
7.1.150.0220.00816.07
7.1.140.0210.00816.07
7.1.130.0210.00816.06
7.1.120.0210.00816.08
7.1.110.0220.00816.12
7.1.100.0230.00716.10
7.1.90.0240.00816.12
7.1.80.0200.00816.10
7.1.70.0200.00816.10
7.1.60.0240.00716.11
7.1.50.0190.00816.08
7.1.40.0180.00816.12
7.1.30.0190.00816.14
7.1.20.0180.00916.17
7.1.10.0180.00816.12
7.1.00.0230.00816.07
7.0.330.0230.00715.91
7.0.320.0210.00715.91
7.0.310.0230.00715.87
7.0.300.0220.00715.91
7.0.290.0200.00715.89
7.0.280.0210.00715.89
7.0.270.0220.00815.88
7.0.260.0210.00815.90
7.0.250.0220.00815.92
7.0.240.0210.00715.94
7.0.230.0200.00815.94
7.0.220.0200.00915.96
7.0.210.0200.00815.92
7.0.200.0190.00715.93
7.0.190.0200.00815.92
7.0.180.0200.00815.94
7.0.170.0190.00715.96
7.0.160.0200.00815.94
7.0.150.0190.00715.92
7.0.140.0190.00715.90
7.0.130.0180.00715.91
7.0.120.0180.00815.94
7.0.110.0200.00815.92
7.0.100.0190.00715.90
7.0.90.0170.00815.89
7.0.80.0260.00815.91
7.0.70.0190.00715.94
7.0.60.0210.00815.88
7.0.50.0180.00815.91
7.0.40.0210.00715.92
7.0.30.0180.00815.90
7.0.20.0200.00715.88
7.0.10.0190.00815.91
7.0.00.0210.00815.96
5.6.400.0160.00816.38
5.6.390.0180.00816.33
5.6.380.0160.01016.26
5.6.370.0170.00916.27
5.6.360.0160.00916.28
5.6.350.0160.00916.24
5.6.340.0160.01016.27
5.6.330.0150.01016.25
5.6.320.0170.00916.28
5.6.310.0160.01016.26
5.6.300.0170.00816.25
5.6.290.0150.00916.28
5.6.280.0160.00916.27
5.6.270.0150.00916.29
5.6.260.0160.00916.27
5.6.250.0160.00916.23
5.6.240.0160.00916.26
5.6.230.0160.00916.28
5.6.220.0150.00916.24
5.6.210.0150.01016.21
5.6.200.0160.00916.24
5.6.190.0160.00916.23
5.6.180.0160.00816.22
5.6.170.0160.00916.23
5.6.160.0160.00916.25
5.6.150.0160.00916.22
5.6.140.0160.00816.22
5.6.130.0160.00916.21
5.6.120.0160.00916.23
5.6.110.0160.00916.18
5.6.100.0150.01016.24
5.6.90.0170.00916.20
5.6.80.0160.00816.15
5.6.70.0150.01016.18
5.6.60.0160.00916.18
5.6.50.0150.00916.18
5.6.40.0150.00916.17
5.6.30.0150.00916.17
5.6.20.0160.00816.19
5.6.10.0150.00916.16
5.6.00.0140.01016.15
5.5.380.0170.00916.16
5.5.370.0160.00916.16
5.5.360.0160.00916.13
5.5.350.0160.00916.02
5.5.340.0150.00916.01
5.5.330.0160.00916.06
5.5.320.0160.00916.05
5.5.310.0150.01016.04
5.5.300.0160.00916.05
5.5.290.0160.00916.02
5.5.280.0150.01016.04
5.5.270.0160.00916.04
5.5.260.0150.01016.07
5.5.250.0160.00916.02
5.5.240.0150.01016.01
5.5.230.0160.00916.01
5.5.220.0160.00915.98
5.5.210.0150.00916.04
5.5.200.0150.00916.01
5.5.190.0150.01015.99
5.5.180.0160.00915.99
5.5.170.0150.01016.04
5.5.160.0150.00916.00
5.5.150.0150.00915.99
5.5.140.0140.01015.98
5.5.130.0170.00815.97
5.5.120.0150.00915.97
5.5.110.0140.01015.98
5.5.100.0160.00816.02
5.5.90.0150.00915.99
5.5.80.0150.00916.01
5.5.70.0160.00915.98
5.5.60.0150.00915.98
5.5.50.0160.00915.98
5.5.40.0160.00915.99
5.5.30.0160.00915.98
5.5.20.0160.00916.00
5.5.10.0160.00915.95
5.5.00.0170.00915.93

preferences:
35.6 ms | 401 KiB | 5 Q