3v4l.org

run code in 300+ PHP versions simultaneously
<?php $textToEncrypt = "Secret Text to Encrypt"; $encryptionMethod = 'aes-256-cbc'; $secretHash = "315a5504d921f8327f73a356d2bbcbf1"; // <---- you have to use some persistent. $iv_size = openssl_cipher_iv_length($encryptionMethod ); $iv = openssl_random_pseudo_bytes($iv_size); //To encrypt $encryptedMessage = openssl_encrypt($textToEncrypt, $encryptionMethod, $secretHash, 0, $iv); //Concatenate iv with data $encryptedMessageWithIv = bin2hex($iv) . $encryptedMessage; //To Decrypt $iv_size = openssl_cipher_iv_length($encryptionMethod ); $iv = hex2bin(substr($encryptedMessageWithIv, 0, $iv_size*2)); $decryptedMessage = openssl_decrypt(substr($encryptedMessageWithIv, $iv_size*2), $encryptionMethod, $secretHash, 0, $iv); echo "Encrypted: $encryptedMessageWithIv <br>Decrypted: $decryptedMessage";

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.70.0090.00618.30
8.3.60.0040.01818.43
8.3.50.0160.00421.97
8.3.40.0040.01118.67
8.3.30.0110.00318.68
8.3.20.0040.00421.86
8.3.10.0090.00621.59
8.3.00.0080.00019.26
8.2.190.0120.00318.61
8.2.180.0040.01118.28
8.2.170.0180.00418.82
8.2.160.0070.01022.96
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0040.00421.00
8.2.110.0030.00722.23
8.2.100.0080.00417.84
8.2.90.0040.00417.91
8.2.80.0060.00319.05
8.2.70.0040.00417.67
8.2.60.0040.00417.92
8.2.50.0080.00018.10
8.2.40.0050.00320.77
8.2.30.0040.00419.07
8.2.20.0050.00217.90
8.2.10.0040.00418.05
8.2.00.0040.00417.84
8.1.280.0090.00625.92
8.1.270.0040.00420.29
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0050.00522.28
8.1.230.0040.00722.75
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0040.00417.48
8.1.190.0000.01117.23
8.1.180.0040.00418.10
8.1.170.0050.00318.87
8.1.160.0000.00718.88
8.1.150.0030.00320.27
8.1.140.0000.00719.36
8.1.130.0030.00318.88
8.1.120.0070.00017.39
8.1.110.0070.00017.42
8.1.100.0000.00817.38
8.1.90.0000.00717.32
8.1.80.0000.00817.30
8.1.70.0030.00317.41
8.1.60.0030.00617.50
8.1.50.0000.00817.54
8.1.40.0050.00317.48
8.1.30.0050.00317.63
8.1.20.0000.00817.48
8.1.10.0040.00417.55
8.1.00.0000.00717.54
8.0.300.0040.00419.96
8.0.290.0040.00416.75
8.0.280.0000.00818.25
8.0.270.0070.00017.16
8.0.260.0030.00317.18
8.0.250.0030.00316.87
8.0.240.0080.00016.85
8.0.230.0000.00716.92
8.0.220.0040.00416.84
8.0.210.0030.00316.91
8.0.200.0000.00716.95
8.0.190.0070.00316.82
8.0.180.0070.00016.88
8.0.170.0070.00016.98
8.0.160.0070.00016.78
8.0.150.0000.00716.79
8.0.140.0040.00416.89
8.0.130.0000.00713.34
8.0.120.0050.00216.80
8.0.110.0000.00816.71
8.0.100.0040.00416.79
8.0.90.0050.00316.78
8.0.80.0030.01116.78
8.0.70.0040.00416.77
8.0.60.0000.00816.89
8.0.50.0020.00516.80
8.0.30.0100.00917.02
8.0.20.0130.00717.30
8.0.10.0040.01217.02
8.0.00.0080.00916.80
7.4.330.0000.00515.55
7.4.320.0000.00716.54
7.4.300.0050.00216.51
7.4.290.0000.00716.52
7.4.280.0090.00316.52
7.4.270.0000.00816.50
7.4.260.0040.00416.48
7.4.250.0000.00716.46
7.4.240.0000.00716.45
7.4.230.0030.00316.50
7.4.220.0150.00816.55
7.4.210.0130.00616.58
7.4.200.0000.00716.30
7.4.160.0090.00916.49
7.4.150.0060.01016.93
7.4.140.0120.00917.51
7.4.130.0050.01216.61
7.4.120.0080.01216.61
7.4.110.0090.00816.32
7.4.100.0100.00716.49
7.4.90.0100.00816.45
7.4.80.0110.00617.45
7.4.70.0070.01116.51
7.4.60.0080.00916.37
7.4.50.0140.00316.50
7.4.40.0130.00616.36
7.4.30.0090.00716.50
7.4.20.0080.00916.49
7.4.10.0110.00916.46
7.4.00.0090.00916.43
7.3.330.0020.00213.17
7.3.320.0050.00013.09
7.3.310.0000.00716.21
7.3.300.0000.00716.18
7.3.290.0090.00616.23
7.3.280.0100.00716.33
7.3.270.0130.00616.82
7.3.260.0070.00916.21
7.3.250.0090.00816.36
7.3.240.0100.00716.25
7.3.230.0070.00916.23
7.3.220.0060.01016.29
7.3.210.0090.00816.30
7.3.200.0050.01316.20
7.3.190.0090.00816.28
7.3.180.0070.01016.20
7.3.170.0080.01016.36
7.3.160.0060.01016.23
7.3.150.0080.00816.35
7.3.140.0070.01116.23
7.3.130.0110.00816.23
7.3.120.0080.01016.16
7.3.110.0090.00916.10
7.3.100.0080.00916.27
7.3.90.0090.00916.32
7.3.80.0080.01216.10
7.3.70.0100.01116.23
7.3.60.0060.00916.20
7.3.50.0080.00916.28
7.3.40.0040.01416.35
7.3.30.0090.01216.31
7.3.20.0100.00716.28
7.3.10.0140.00916.24
7.3.00.0130.00516.15
7.2.340.0180.01116.11
7.2.330.0140.00616.37
7.2.320.0130.00916.19
7.2.310.0130.00816.48
7.2.300.0140.01016.27
7.2.290.0100.01116.24
7.2.280.0160.00916.26
7.2.270.0140.01116.21
7.2.260.0130.01016.24
7.2.250.0140.01016.40
7.2.240.0170.00716.32
7.2.230.0140.01016.29
7.2.220.0090.01416.19
7.2.210.0120.00916.31
7.2.200.0120.01016.33
7.2.190.0120.00916.30
7.2.180.0140.00616.35
7.2.170.0140.00716.33
7.2.160.0170.00816.31
7.2.150.0130.00816.42
7.2.140.0140.00716.57
7.2.130.0130.00816.37
7.2.120.0190.00816.44
7.2.110.0230.01116.47
7.2.100.0160.00916.53
7.2.90.0180.00616.38
7.2.80.0160.00916.45
7.2.70.0160.00816.36
7.2.60.0130.00816.30
7.2.50.0120.01216.37
7.2.40.0120.01016.37
7.2.30.0080.01516.43
7.2.20.0090.01216.39
7.2.10.0120.00916.38
7.2.00.0200.00716.42
7.1.330.0120.01115.14
7.1.320.0140.00915.18
7.1.310.0140.00815.18
7.1.300.0110.00915.13
7.1.290.0120.00815.30
7.1.280.0130.00915.14
7.1.270.0110.00815.22
7.1.260.0120.00915.20
7.1.250.0120.00815.15
7.1.240.0160.01315.20
7.1.230.0130.00915.20
7.1.220.0110.01015.18
7.1.210.0130.00815.09
7.1.200.0110.01115.23
7.1.190.0150.00315.13
7.1.180.0120.01015.18
7.1.170.0120.01015.20
7.1.160.0220.00815.20
7.1.150.0140.01015.15
7.1.140.0120.00815.15
7.1.130.0120.00815.22
7.1.120.0150.01215.12
7.1.110.0150.00715.19
7.1.100.0130.00915.22
7.1.90.0150.00915.16
7.1.80.0110.01015.24
7.1.70.0110.01015.22
7.1.60.0140.00815.27
7.1.50.0150.00815.20
7.1.40.0140.00815.13
7.1.30.0130.01115.27
7.1.20.0190.00615.19
7.1.10.0140.01414.82
7.1.00.0410.01014.81
7.0.330.0110.01014.93
7.0.320.0140.00914.96
7.0.310.0140.00615.03
7.0.300.0090.00615.52
7.0.290.0080.01314.99
7.0.280.0110.01314.99
7.0.270.0120.00715.05
7.0.260.0130.00714.94
7.0.250.0130.00915.11
7.0.240.0110.01115.01
7.0.230.0110.01115.12
7.0.220.0130.00714.94
7.0.210.0180.00414.97
7.0.200.0130.00814.97
7.0.190.0220.00614.89
7.0.180.0080.01214.96
7.0.170.0140.00815.04
7.0.160.0200.01014.91
7.0.150.0470.00514.54
7.0.140.0390.00814.64
7.0.130.0220.01114.53
7.0.120.0350.00914.57
7.0.110.0380.00814.52
7.0.100.0340.01014.41
7.0.90.0420.01114.53
7.0.80.0420.00814.59
7.0.70.0350.00814.40
7.0.60.0440.00614.51
7.0.50.0390.00714.51
7.0.40.0310.01214.46
7.0.30.0410.00714.54
7.0.20.0370.00914.52
7.0.10.0420.00714.54
7.0.00.0360.00814.53
5.6.400.0140.00915.75
5.6.390.0170.00815.49
5.6.380.0070.01415.65
5.6.370.0120.00915.70
5.6.360.0140.00815.71
5.6.350.0120.00915.64
5.6.340.0100.01015.67
5.6.330.0120.00915.86
5.6.320.0110.01015.70
5.6.310.0080.01415.43
5.6.300.0150.00815.05
5.6.290.0110.01115.16
5.6.280.0130.00815.23
5.6.270.0110.01115.15
5.6.260.0150.01015.31
5.6.250.0090.01015.08
5.6.240.0120.01015.14
5.6.230.0130.00815.27
5.6.220.0100.01115.09
5.6.210.0110.01215.08
5.6.200.0110.01215.09
5.6.190.0150.00815.17
5.6.180.0100.01215.17
5.6.170.0110.01015.19
5.6.160.0130.01115.11
5.6.150.0160.00715.25
5.6.140.0140.00915.27
5.6.130.0150.00615.13
5.6.120.0120.01015.19
5.6.110.0120.00915.11
5.6.100.0070.01515.02
5.6.90.0170.00715.19
5.6.80.0150.00715.16
5.6.70.0120.00915.05
5.6.60.0090.01315.15
5.6.50.0120.01115.07
5.6.40.0130.00915.06
5.6.30.0160.00715.10
5.6.20.0120.01215.15
5.6.10.0140.01015.06
5.6.00.0150.00715.13
5.4.450.0030.00512.25

preferences:
30.75 ms | 401 KiB | 5 Q