3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Set the method $method = 'AES-256-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.4.130.0050.00418.99
8.4.120.0270.00820.77
8.4.110.0250.00919.95
8.4.100.0270.00817.62
8.4.90.0210.00417.86
8.4.80.0240.00718.63
8.4.70.0260.00718.21
8.4.60.0230.00718.28
8.4.50.0210.00918.31
8.4.40.0320.00518.52
8.4.30.0250.00617.79
8.4.20.0290.00718.54
8.4.10.0280.00517.75
8.3.260.0050.00416.41
8.3.250.0230.01017.59
8.3.240.0270.00716.87
8.3.230.0270.00616.60
8.3.220.0240.00416.54
8.3.210.0240.00616.63
8.3.200.0120.00316.72
8.3.190.0130.00717.00
8.3.180.0140.00416.56
8.3.170.0210.00817.51
8.3.160.0250.00717.43
8.3.150.0190.00716.69
8.3.140.0240.00316.80
8.3.130.0170.00417.56
8.3.120.0220.00417.61
8.3.110.0160.00416.66
8.3.100.0180.00916.46
8.3.90.0240.00517.35
8.3.80.0260.00517.38
8.3.70.0240.01016.63
8.3.60.0360.00816.54
8.3.50.0270.00720.74
8.3.40.0260.00818.14
8.3.30.0240.00718.07
8.3.20.0220.00419.66
8.3.10.0120.00520.75
8.3.00.0140.00319.25
8.2.290.0170.00718.53
8.2.280.0120.00719.72
8.2.270.0220.00516.86
8.2.260.0190.01117.36
8.2.250.0190.00717.76
8.2.240.0210.00217.76
8.2.230.0200.00918.70
8.2.220.0220.00420.24
8.2.210.0210.00921.63
8.2.200.0190.00316.51
8.2.190.0230.00816.70
8.2.180.0190.01117.54
8.2.170.0240.00620.36
8.2.160.0250.00619.13
8.2.150.0120.00520.96
8.2.140.0180.00621.10
8.2.130.0190.00718.51
8.2.120.0190.00421.98
8.2.110.0090.00619.27
8.2.100.0130.00417.69
8.2.90.0170.00617.61
8.2.80.0080.00617.81
8.2.70.0110.00217.72
8.2.60.0150.00217.79
8.2.50.0240.00417.61
8.2.40.0260.00320.03
8.2.30.0120.00718.37
8.2.20.0180.00417.63
8.2.10.0170.00617.82
8.2.00.0130.00517.75
8.1.330.0130.00619.01
8.1.320.0150.00616.40
8.1.310.0120.00817.36
8.1.300.0170.00817.98
8.1.290.0160.00717.49
8.1.280.0190.00921.15
8.1.270.0200.00519.67
8.1.260.0190.00421.77
8.1.250.0180.00422.58
8.1.240.0200.00720.55
8.1.230.0180.00619.96
8.1.220.0200.00417.47
8.1.210.0140.01017.85
8.1.200.0160.00817.17
8.1.190.0140.00617.27
8.1.180.0130.00817.70
8.1.170.0150.00717.98
8.1.160.0150.00717.99
8.1.150.0170.00418.65
8.1.140.0140.00818.38
8.1.130.0150.00718.08
8.1.120.0160.00717.20
8.1.110.0230.00617.34
8.1.100.0140.00817.30
8.1.90.0160.00717.17
8.1.80.0150.01017.26
8.1.70.0180.00617.17
8.1.60.0230.00517.40
8.1.50.0130.00417.42
8.1.40.0070.00817.45
8.1.30.0180.00617.51
8.1.20.0160.00817.57
8.1.10.0090.00417.49
8.1.00.0090.00417.43
8.0.300.0160.00618.13
8.0.290.0150.00716.55
8.0.280.0180.00417.46
8.0.270.0150.00816.90
8.0.260.0170.00616.86
8.0.250.0190.00216.65
8.0.240.0180.00416.64
8.0.230.0150.00716.74
8.0.220.0180.00516.71
8.0.210.0150.00816.76
8.0.200.0180.00516.78
8.0.190.0190.00416.82
8.0.180.0180.00616.67
8.0.170.0160.00616.68
8.0.160.0100.00616.82
8.0.150.0040.00716.82
8.0.140.0080.00716.72
8.0.130.0100.00314.82
8.0.120.0190.00616.73
8.0.110.0170.00716.64
8.0.100.0190.00316.61
8.0.90.0180.00516.70
8.0.80.0220.00816.52
8.0.70.0200.00416.71
8.0.60.0210.00516.79
8.0.50.0170.00516.63
8.0.30.0160.00716.88
8.0.20.0140.01017.24
8.0.10.0190.00516.88
8.0.00.0220.00916.57
7.4.330.0150.00515.80
7.4.320.0150.00616.35
7.4.300.0160.00416.41
7.4.290.0150.00616.56
7.4.280.0180.00416.32
7.4.270.0180.00416.50
7.4.260.0140.00616.41
7.4.250.0170.00416.35
7.4.240.0170.00816.46
7.4.230.0180.00316.48
7.4.220.0160.01116.38
7.4.210.0200.00816.40
7.4.200.0130.00716.38
7.4.190.0250.00816.41
7.4.180.0300.00616.33
7.4.160.0160.00616.49
7.4.150.0180.01016.74
7.4.140.0130.01017.41
7.4.130.0130.00716.43
7.4.120.0170.00816.39
7.4.110.0200.00616.38
7.4.100.0190.00716.46
7.4.90.0170.00816.28
7.4.80.0190.00817.63
7.4.70.0180.01016.36
7.4.60.0210.00616.31
7.4.50.0230.00616.23
7.4.40.0200.00816.40
7.4.30.0180.01016.39
7.4.20.0260.00416.25
7.4.10.0120.00815.43
7.4.00.0150.01015.56
7.3.330.0140.00714.49
7.3.320.0170.00514.56
7.3.310.0150.00716.06
7.3.300.0130.00816.16
7.3.290.0110.01016.18
7.3.280.0110.01016.21
7.3.270.0180.01116.80
7.3.260.0170.00816.18
7.3.250.0120.00916.24
7.3.240.0140.00916.26
7.3.230.0160.00816.12
7.3.220.0240.00916.03
7.3.210.0140.00316.07
7.3.200.0110.00617.58
7.3.190.0230.00616.21
7.3.180.0200.00616.10
7.3.170.0220.00516.18
7.3.160.0180.00416.30
7.3.150.0260.00715.68
7.3.140.0270.01115.87
7.3.130.0090.01115.51
7.3.120.0070.01215.46
7.3.110.0180.00915.45
7.3.100.0150.00815.28
7.3.90.0160.00715.54
7.3.80.0230.00315.39
7.3.70.0170.00515.41
7.3.60.0220.00715.41
7.3.50.0160.01015.27
7.3.40.0130.01115.48
7.3.30.0180.00715.39
7.3.20.0200.00716.33
7.3.10.0140.00816.31
7.3.00.0090.00616.20
7.2.340.0250.00815.93
7.2.330.0170.00916.12
7.2.320.0150.01316.01
7.2.310.0230.00516.22
7.2.300.0150.01016.13
7.2.290.0160.00916.26
7.2.280.0250.01016.07
7.2.270.0340.00616.06
7.2.260.0140.01415.35
7.2.250.0190.00615.50
7.2.240.0160.00615.48
7.2.230.0120.00515.38
7.2.220.0070.01215.24
7.2.210.0160.00715.24
7.2.200.0180.00415.48
7.2.190.0160.01115.44
7.2.180.0210.01015.32
7.2.170.0120.01115.43
7.2.160.0110.00815.43
7.2.150.0150.00816.48
7.2.140.0130.00516.40
7.2.130.0170.00416.33
7.2.120.0150.00616.40
7.2.110.0230.00616.43
7.2.100.0200.00616.51
7.2.90.0160.00316.33
7.2.80.0070.00816.63
7.2.70.0170.00716.46
7.2.60.0200.00716.39
7.2.50.0160.00816.62
7.2.40.0180.00916.49
7.2.30.0180.00716.61
7.2.20.0150.01216.44
7.2.10.0200.00716.56
7.2.00.0210.00616.57
7.1.330.0200.00515.28
7.1.320.0180.00415.21
7.1.310.0120.00415.33
7.1.300.0110.00615.53
7.1.290.0080.00615.39
7.1.280.0160.00815.59
7.1.270.0160.00815.42
7.1.260.0200.00515.39
7.1.250.0140.00915.24
7.1.240.0100.00415.24
7.1.230.0130.00415.28
7.1.220.0180.00615.35
7.1.210.0090.00515.54
7.1.200.0080.00715.46
7.1.190.0090.00615.54
7.1.180.0090.00715.30
7.1.170.0110.00315.25
7.1.160.0080.00615.49
7.1.150.0080.00615.24
7.1.140.0080.00515.41
7.1.130.0090.00615.39
7.1.120.0720.01015.34
7.1.110.0170.00515.43
7.1.100.0210.00515.38
7.1.90.0150.01115.49
7.1.80.0190.00915.41
7.1.70.0170.00515.31
7.1.60.0210.00415.41
7.1.50.0180.00915.45
7.1.40.0140.00515.59
7.1.30.0130.01015.35
7.1.20.0180.00615.22
7.1.10.0460.00814.74
7.1.00.0410.00614.84
7.0.330.0150.00914.94
7.0.320.0180.00814.98
7.0.310.0130.00915.08
7.0.300.0150.00715.10
7.0.290.0200.00515.16
7.0.280.0130.00615.21
7.0.270.0140.00614.75
7.0.260.0140.01214.97
7.0.250.0140.01214.98
7.0.240.0410.00614.91
7.0.230.0100.01015.21
7.0.220.0090.00715.16
7.0.210.0180.00514.90
7.0.200.0130.00815.22
7.0.190.0100.00515.07
7.0.180.0090.00615.04
7.0.170.0090.00315.17
7.0.160.0070.00815.13
7.0.150.0460.00514.52
7.0.140.0420.00614.47
7.0.130.0490.00614.61
7.0.120.0500.00614.42
7.0.110.0450.00914.55
7.0.100.0490.00314.46
7.0.90.0550.00914.43
7.0.80.0490.00214.39
7.0.70.0400.00514.53
7.0.60.0430.00514.53
7.0.50.0440.00414.54
7.0.40.0540.00613.86
7.0.30.0460.00513.86
7.0.20.0560.00813.95
7.0.10.0410.00513.91
7.0.00.0490.00513.89
5.6.400.0170.00714.87
5.6.390.0080.00514.89
5.6.380.0110.00714.99
5.6.370.0110.00914.72
5.6.360.0060.00814.70
5.6.350.0130.00514.89
5.6.340.0110.00114.82
5.6.330.0130.01114.79
5.6.320.0140.00915.01
5.6.310.0130.00614.81
5.6.300.0070.00814.96
5.6.290.0210.00714.93
5.6.280.0120.00914.70
5.6.270.0150.01014.89
5.6.260.0170.00614.72
5.6.250.0160.00914.71
5.6.240.0160.01114.75
5.6.230.0150.00914.85
5.6.220.0140.01014.71
5.6.210.0160.00814.85
5.6.200.0160.00814.90
5.6.190.0110.00514.66
5.6.180.0110.01014.64
5.6.170.0120.00614.71
5.6.160.0090.00614.98
5.6.150.0180.00314.82
5.6.140.0150.00914.65
5.6.130.0160.00614.68
5.6.120.0200.00714.78
5.6.110.0110.00514.73
5.6.100.0130.00314.74
5.6.90.0090.00514.88
5.6.80.0140.00814.76
5.6.70.0140.01114.62
5.6.60.0100.01014.89
5.6.50.0160.00514.57
5.6.40.0140.01014.89
5.6.30.0120.00914.68
5.6.20.0180.00514.91
5.6.10.0150.01014.56
5.6.00.0180.00914.75

preferences:
118.35 ms | 403 KiB | 5 Q