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); // 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.0120.00916.75
8.3.50.0070.00717.88
8.3.40.0120.00318.97
8.3.30.0100.00318.83
8.3.20.0070.00019.20
8.3.10.0030.01021.70
8.3.00.0040.00420.80
8.2.180.0110.00416.73
8.2.170.0170.00322.96
8.2.160.0110.00320.45
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0140.00419.55
8.2.110.0060.00322.16
8.2.100.0060.00617.91
8.2.90.0040.00417.91
8.2.80.0040.00419.16
8.2.70.0080.00017.50
8.2.60.0030.00617.80
8.2.50.0060.00318.10
8.2.40.0060.00322.23
8.2.30.0050.00319.11
8.2.20.0030.00617.69
8.2.10.0060.00318.12
8.2.00.0070.00017.91
8.1.280.0160.00025.92
8.1.270.0160.00024.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00423.80
8.1.230.0000.01122.73
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0030.00617.12
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.00818.65
8.1.160.0000.00719.02
8.1.150.0040.00418.80
8.1.140.0040.00419.50
8.1.130.0030.00317.55
8.1.120.0000.00717.27
8.1.110.0000.00717.35
8.1.100.0020.00517.27
8.1.90.0050.00717.32
8.1.80.0060.00717.27
8.1.70.0060.00517.32
8.1.60.0050.00917.51
8.1.50.0070.00617.45
8.1.40.0080.00517.50
8.1.30.0040.00917.66
8.1.20.0030.00917.57
8.1.10.0130.00017.52
8.1.00.0140.00017.38
8.0.300.0050.00220.11
8.0.290.0070.00016.63
8.0.280.0000.00718.35
8.0.270.0020.00517.17
8.0.260.0000.00817.13
8.0.250.0030.00316.98
8.0.240.0000.00717.00
8.0.230.0070.00416.88
8.0.220.0040.00916.79
8.0.210.0080.00316.85
8.0.200.0050.00616.85
8.0.190.0050.00716.86
8.0.180.0040.00716.85
8.0.170.0080.00316.91
8.0.160.0020.00816.78
8.0.150.0060.00516.68
8.0.140.0060.00516.79
8.0.130.0050.00715.06
8.0.120.0070.00416.74
8.0.110.0080.00416.86
8.0.100.0110.00016.82
8.0.90.0120.00016.79
8.0.80.0090.00716.79
8.0.70.0080.00416.71
8.0.60.0060.00516.85
8.0.50.0040.00716.83
8.0.30.0110.00616.90
8.0.20.0130.00717.30
8.0.10.0100.00116.88
8.0.00.0140.00516.81
7.4.330.0000.00515.08
7.4.320.0020.00516.49
7.4.300.0020.00516.56
7.4.290.0110.00016.56
7.4.280.0040.00616.50
7.4.270.0070.00616.51
7.4.260.0100.00516.55
7.4.250.0070.00516.42
7.4.240.0100.00216.59
7.4.230.0120.00016.63
7.4.220.0050.01216.45
7.4.210.0070.00916.50
7.4.200.0040.00616.46
7.4.190.0090.00616.52
7.4.180.0040.01116.52
7.4.160.0070.00716.48
7.4.150.0110.00516.88
7.4.140.0120.00617.40
7.4.130.0140.00416.40
7.4.120.0100.00816.44
7.4.110.0110.00816.41
7.4.100.0100.01016.54
7.4.90.0110.00916.28
7.4.80.0120.00817.01
7.4.70.0150.00516.46
7.4.60.0090.00816.42
7.4.50.0120.00816.48
7.4.40.0090.01116.41
7.4.30.0100.01116.40
7.4.20.0090.00816.54
7.4.10.0090.00916.48
7.4.00.0090.00816.10
7.3.330.0060.00414.64
7.3.320.0060.00514.57
7.3.310.0090.00316.20
7.3.300.0060.00516.13
7.3.290.0120.00216.18
7.3.280.0090.00816.27
7.3.270.0080.00716.85
7.3.260.0110.00916.18
7.3.250.0100.00816.23
7.3.240.0120.00816.25
7.3.230.0120.00616.24
7.3.220.0130.00516.31
7.3.210.0100.00916.18
7.3.200.0080.01116.31
7.3.190.0120.00516.30
7.3.180.0130.00416.20
7.3.170.0090.00916.38
7.3.160.0120.00616.27
7.3.150.0080.01116.24
7.3.140.0130.00516.29
7.3.130.0120.00516.29
7.3.120.0070.01116.23
7.3.110.0100.00715.96
7.3.100.0090.00816.00
7.3.90.0090.00915.95
7.3.80.0100.00715.91
7.3.70.0130.00415.92
7.3.60.0120.00715.91
7.3.50.0090.01015.85
7.3.40.0130.00515.96
7.3.30.0090.01015.90
7.3.20.0120.00616.33
7.3.10.0090.01016.36
7.3.00.0090.00916.26
7.2.340.0180.00616.34
7.2.330.0090.00816.30
7.2.320.0120.00816.33
7.2.310.0130.00916.44
7.2.300.0090.01016.39
7.2.290.0120.00716.41
7.2.280.0100.01116.28
7.2.270.0110.00916.31
7.2.260.0120.00816.45
7.2.250.0120.00716.43
7.2.240.0110.01016.07
7.2.230.0160.00715.98
7.2.220.0120.00816.06
7.2.210.0110.00815.95
7.2.200.0070.01216.06
7.2.190.0120.00816.08
7.2.180.0110.00815.98
7.2.170.0120.00716.15
7.2.160.0100.01216.07
7.2.150.0100.01016.41
7.2.140.0100.00916.48
7.2.130.0160.00716.56
7.2.120.0080.00916.56
7.2.110.0090.01016.52
7.2.100.0110.00816.58
7.2.90.0110.00816.49
7.2.80.0140.00716.49
7.2.70.0120.00916.59
7.2.60.0180.00616.53
7.2.50.0150.00516.50
7.2.40.0110.00716.57
7.2.30.0100.01016.51
7.2.20.0110.00816.53
7.2.10.0130.00816.49
7.2.00.0100.00917.32
7.1.330.0160.00615.38
7.1.320.0140.00615.32
7.1.310.0120.00815.28
7.1.300.0130.00915.40
7.1.290.0170.00615.43
7.1.280.0160.00915.35
7.1.270.0130.01015.41
7.1.260.0110.00915.25
7.1.250.0140.00715.40
7.1.240.0120.00915.26
7.1.230.0140.00815.26
7.1.220.0150.00615.37
7.1.210.0120.00815.30
7.1.200.0120.00915.35
7.1.190.0170.00315.25
7.1.180.0110.01115.27
7.1.170.0160.00815.36
7.1.160.0150.00715.35
7.1.150.0160.00615.36
7.1.140.0160.00515.35
7.1.130.0150.00715.35
7.1.120.0110.01015.93
7.1.110.0160.00915.86
7.1.100.0130.00715.79
7.1.90.0140.00915.74
7.1.80.0150.00815.76
7.1.70.0150.00615.84
7.1.60.0160.01018.67
7.1.50.0180.01120.89
7.1.40.0190.00818.55
7.1.30.0180.00818.56
7.1.20.0140.00918.50
7.1.10.0130.01215.61
7.1.00.0140.01816.55
7.0.330.0170.00615.13
7.0.320.0130.00815.10
7.0.310.0220.00515.06
7.0.300.0180.00815.07
7.0.290.0180.00815.13
7.0.280.0160.00815.11
7.0.270.0180.00915.11
7.0.260.0180.00715.70
7.0.250.0180.01115.57
7.0.240.0110.01215.56
7.0.230.0190.00615.62
7.0.220.0170.01015.51
7.0.210.0170.00915.43
7.0.200.0120.01015.53
7.0.190.0200.00615.42
7.0.180.0150.00915.30
7.0.170.0140.01015.29
7.0.160.0160.00915.31
7.0.150.0180.00815.39
7.0.140.0170.01115.31
7.0.130.0160.00815.39
7.0.120.0160.00715.36
7.0.110.0160.00915.33
7.0.100.0150.00815.36
7.0.90.0180.00515.26
7.0.80.0150.00915.24
7.0.70.0180.00915.22
7.0.60.0150.01715.98
7.0.50.0350.01316.03
7.0.40.0300.01616.04
7.0.30.0340.01716.02
7.0.20.0320.01515.72
7.0.10.0310.01716.07
7.0.00.0290.01616.06
5.6.400.0180.00815.37
5.6.390.0120.01015.36
5.6.380.0160.00815.45
5.6.370.0160.00915.39
5.6.360.0170.00815.45
5.6.350.0180.00815.26
5.6.340.0160.00715.38
5.6.330.0170.01015.33
5.6.320.0160.00915.30
5.6.310.0160.01215.36
5.6.300.0170.02116.25
5.6.290.0160.02016.20
5.6.280.0160.02316.89
5.6.270.0190.01416.35
5.6.260.0140.01716.30
5.6.250.0160.01616.27
5.6.240.0170.01616.28
5.6.230.0140.02016.27
5.6.220.0180.01716.31
5.6.210.0160.02616.96
5.6.200.0300.02616.95
5.6.190.0340.02217.01
5.6.180.0320.02316.94
5.6.170.0300.02516.99
5.6.160.0260.02716.87
5.6.150.0300.02516.96
5.6.140.0300.02216.94
5.6.130.0260.02616.98
5.6.120.0120.02717.00
5.6.110.0200.02316.96
5.6.100.0260.02516.92
5.6.90.0290.02216.97
5.6.80.0280.02616.78
5.6.70.0270.02216.75
5.6.60.0280.02416.70
5.6.50.0310.02116.74
5.6.40.0360.02316.67
5.6.30.0310.02316.73
5.6.20.0310.02016.69
5.6.10.0330.02716.72
5.6.00.0290.02316.74
5.5.380.0130.02215.74
5.5.370.0170.01615.72
5.5.360.0120.02015.61
5.5.350.0220.02216.33
5.5.340.0310.02116.46
5.5.330.0320.02416.33
5.5.320.0300.02316.41
5.5.310.0320.02816.42
5.5.300.0310.02216.44
5.5.290.0290.02416.51
5.5.280.0170.02316.41
5.5.270.0240.02516.43
5.5.260.0290.02416.34
5.5.250.0300.02216.44
5.5.240.0260.02716.17
5.5.230.0340.02216.16
5.5.220.0260.02716.23
5.5.210.0310.02116.29
5.5.200.0300.02316.15
5.5.190.0280.02616.11
5.5.180.0250.02616.22
5.5.170.0120.01315.16
5.5.160.0370.01916.19
5.5.150.0290.02016.25
5.5.140.0300.02216.21
5.5.130.0310.02116.11
5.5.120.0270.02216.12
5.5.110.0250.02416.18
5.5.100.0240.02516.20
5.5.90.0320.02616.17
5.5.80.0260.02316.21
5.5.70.0260.02616.12
5.5.60.0260.02316.19
5.5.50.0300.02316.12
5.5.40.0290.02516.12
5.5.30.0290.02616.15
5.5.20.0280.02616.29
5.5.10.0280.02416.17
5.5.00.0260.02316.16

preferences:
84.69 ms | 401 KiB | 5 Q