3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key1 = "this is a secret key"; $key2 = "this is the second secret key"; $input = "Let us meet at 9 o'clock at the secret place."; $length = strlen($input); /* Open the cipher */ $td = mcrypt_module_open('rijndael-256', '', 'cbc', ''); /* Create the IV and determine the keysize length, use MCRYPT_RAND * on Windows instead */ $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); $ks = mcrypt_enc_get_key_size($td); /* Create key */ $key1 = md5($key1); $key2 = md5($key2); $key = substr($key1, 0, $ks/2) . substr(strtoupper($key2), (round(strlen($key2) / 2)), $ks/2); $key = substr($key.$key1.$key2.strtoupper($key1),0,$ks); /* Intialize encryption */ mcrypt_generic_init($td, $key, $iv); /* Encrypt data */ $encrypted = mcrypt_generic($td, $input); /* Terminate encryption handler */ mcrypt_generic_deinit($td); /* Initialize encryption module for decryption */ mcrypt_generic_init($td, $key, $iv); /* Decrypt encrypted string */ $decrypted = mdecrypt_generic($td, $encrypted); /* Terminate decryption handle and close module */ mcrypt_generic_deinit($td); mcrypt_module_close($td); /* Show string */ echo "Text: ".substr($decrypted,0,$length) . "<br>"; echo "Encoded: ".$encrypted ."<br>"; echo "<br>key1: $key1 <br>key2: $key2<br>created key: $key";

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.00318.30
8.3.50.0190.00318.05
8.3.40.0040.01118.83
8.3.30.0110.01118.84
8.3.20.0080.00018.77
8.3.10.0080.00020.81
8.3.00.0040.00419.77
8.2.180.0070.00716.50
8.2.170.0090.00622.96
8.2.160.0100.00320.46
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.13
8.2.110.0100.00020.53
8.2.100.0060.00617.79
8.2.90.0040.00418.22
8.2.80.0040.00419.28
8.2.70.0040.00717.63
8.2.60.0000.00817.91
8.2.50.0030.00518.07
8.2.40.0040.00417.78
8.2.30.0000.00819.55
8.2.20.0040.00417.70
8.2.10.0040.00417.78
8.2.00.0040.00417.77
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.02
8.1.230.0100.00322.67
8.1.220.0050.00317.74
8.1.210.0000.00818.82
8.1.200.0030.00617.35
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0040.00418.49
8.1.160.0000.00718.86
8.1.150.0040.00418.61
8.1.140.0000.00717.47
8.1.130.0030.00317.79
8.1.120.0040.00417.41
8.1.110.0070.00017.43
8.1.100.0030.00317.42
8.1.90.0070.00017.39
8.1.80.0020.00517.47
8.1.70.0000.00717.37
8.1.60.0000.00817.54
8.1.50.0040.00417.50
8.1.40.0050.00217.58
8.1.30.0070.00017.55
8.1.20.0050.00517.60
8.1.10.0000.00717.51
8.1.00.0040.00817.51
8.0.300.0080.00020.16
8.0.290.0070.00017.05
8.0.280.0000.00718.41
8.0.270.0030.00317.29
8.0.260.0070.00016.86
8.0.250.0080.00017.05
8.0.240.0030.00516.98
8.0.230.0040.00416.95
8.0.220.0030.00316.92
8.0.210.0030.00516.81
8.0.200.0050.00216.88
8.0.190.0000.00716.87
8.0.180.0030.00316.84
8.0.170.0000.00816.87
8.0.160.0030.00316.85
8.0.150.0030.00516.95
8.0.140.0050.00316.92
8.0.130.0060.00313.35
8.0.120.0040.00416.84
8.0.110.0030.00516.79
8.0.100.0040.00416.94
8.0.90.0080.00016.87
8.0.80.0120.00416.86
8.0.70.0040.00416.93
8.0.60.0040.00416.78
8.0.50.0040.00416.81
8.0.30.0110.01017.13
8.0.20.0140.00617.40
8.0.10.0030.00517.05
8.0.00.0110.00916.79
7.4.330.0000.00516.69
7.4.320.0080.00016.34
7.4.300.0030.00316.53
7.4.290.0000.00716.59
7.4.280.0040.00416.65
7.4.270.0030.00516.45
7.4.260.0000.00513.34
7.4.250.0040.00416.50
7.4.240.0070.00016.50
7.4.230.0030.00316.29
7.4.220.0100.00716.67
7.4.210.0080.01016.60
7.4.200.0000.00716.49
7.4.190.0040.00416.44
7.4.160.0060.00916.72
7.4.150.0140.00417.40
7.4.140.0170.00817.86
7.4.130.0080.01216.55
7.4.120.0070.00916.49
7.4.110.0060.01316.56
7.4.100.0090.00916.54
7.4.90.0120.00916.61
7.4.80.0100.01019.39
7.4.70.0030.01616.48
7.4.60.0080.00816.58
7.4.50.0030.00516.68
7.4.40.0170.00022.77
7.4.30.0070.01016.59
7.4.00.0120.00614.95
7.3.330.0030.00313.14
7.3.320.0000.00613.34
7.3.310.0030.00316.46
7.3.300.0030.00316.22
7.3.290.0070.01416.30
7.3.280.0080.00716.36
7.3.270.0060.01117.40
7.3.260.0110.00818.24
7.3.250.0040.01316.45
7.3.240.0100.00716.33
7.3.230.0110.00816.55
7.3.210.0090.00616.50
7.3.200.0090.00819.39
7.3.190.0090.01216.55
7.3.180.0030.01416.38
7.3.170.0100.00616.38
7.3.160.0040.01216.39
7.3.120.0000.01714.62
7.2.330.0090.00916.63
7.2.320.0060.01616.61
7.2.310.0090.00916.59
7.2.300.0040.01816.59
7.2.290.0140.00416.25
7.2.60.0000.01416.69
7.2.00.0060.00919.24
7.1.200.0080.00415.80
7.1.70.0080.00416.68
7.1.60.0100.01017.18
7.1.50.0090.00516.67
7.1.40.0090.00316.48
7.1.30.0040.01116.39
7.1.20.0070.00716.52
7.1.10.0080.00016.54
7.1.00.0060.00616.59
7.0.200.0000.00816.66
7.0.190.0050.01016.41
7.0.180.0090.00416.08
7.0.170.0100.00316.10
7.0.160.0000.01216.05
7.0.150.0000.00816.36
7.0.140.0100.00716.33
7.0.130.0070.00316.42
7.0.120.0000.00816.41
7.0.110.0000.00716.43
7.0.100.0030.00616.36
7.0.90.0030.01316.34
7.0.80.0060.00316.48
7.0.70.0040.00416.21
7.0.60.0030.00616.02
7.0.50.0000.00716.10
7.0.40.0000.00715.53
7.0.30.0030.00715.53
7.0.20.0040.00415.53
7.0.10.0050.00315.53
7.0.00.0030.00615.53
5.6.300.0030.04320.80
5.6.290.0030.07920.83
5.6.280.0030.04421.00
5.6.270.0030.06321.05
5.6.260.0030.04621.04
5.6.250.0030.04820.86
5.6.240.0070.08620.97
5.6.230.0030.04220.80
5.6.220.0030.04320.82
5.6.210.0030.04420.96
5.6.200.0000.04520.84
5.6.190.0030.05020.86
5.6.180.0070.05620.83
5.6.170.0070.03920.93
5.6.160.0000.04620.78
5.6.150.0030.04620.84
5.6.140.0070.04420.84
5.6.130.0060.04220.98
5.6.120.0000.05120.77
5.6.110.0030.04221.02
5.6.100.0030.04620.73
5.6.90.0070.04320.74
5.6.80.0070.03720.42
5.6.70.0000.04420.21
5.6.60.0030.04320.18
5.6.50.0030.03820.38
5.6.40.0030.03920.42
5.6.30.0360.03320.30
5.6.20.0030.04420.35
5.6.10.0070.03820.39
5.6.00.0030.04020.18
5.5.380.0030.04217.52
5.5.370.0030.03917.46
5.5.360.0040.04117.40
5.5.350.0070.03517.47
5.5.340.0000.04817.89
5.5.330.0070.03818.07
5.5.320.0000.04317.97
5.5.310.0090.03917.97
5.5.300.0040.04318.07
5.5.290.0060.04118.00
5.5.280.0120.03218.06
5.5.270.0070.04118.04
5.5.260.0070.05118.09
5.5.250.0070.03617.79
5.5.240.0040.04017.45
5.5.230.0070.03717.44
5.5.220.0090.03917.29
5.5.210.0030.03717.47
5.5.200.0060.03417.27
5.5.190.0000.04517.24
5.5.180.0070.04117.43
5.5.160.0070.03817.44
5.5.150.0070.04217.41
5.5.140.0090.03217.41
5.5.130.0000.04517.26
5.5.120.0070.04317.41
5.5.110.0030.04817.45
5.5.100.0100.03817.23
5.5.90.0090.04117.24
5.5.80.0000.04417.06
5.5.70.0000.05317.30
5.5.60.0000.04017.31
5.5.50.0030.04117.31
5.5.40.0070.03417.30
5.5.30.0030.04617.36
5.5.20.0060.03517.30
5.5.10.0060.04017.28
5.5.00.0060.03517.04
5.4.450.0030.04319.54
5.4.440.0000.04819.35
5.4.430.0000.04919.26
5.4.420.0290.03219.19
5.4.410.0030.04119.27
5.4.400.0060.03518.91
5.4.390.0000.04618.90
5.4.380.0000.04218.87
5.4.370.0030.04319.18
5.4.360.0070.03719.13
5.4.350.0060.03718.99
5.4.340.0030.03919.21
5.4.320.0070.03519.19
5.4.310.0070.03419.09
5.4.300.0100.04119.04
5.4.290.0060.03419.10
5.4.280.0090.03418.93
5.4.270.0070.03519.09
5.4.260.0100.04219.17
5.4.250.0070.04719.12
5.4.240.0000.04118.93
5.4.230.0030.04119.06
5.4.220.0000.04119.09
5.4.210.0040.04218.89
5.4.200.0060.03919.21
5.4.190.0100.03518.98
5.4.180.0060.03919.02
5.4.170.0060.03519.20
5.4.160.0070.03319.09
5.4.150.0070.04118.96
5.4.140.0000.04016.64
5.4.130.0070.03116.43
5.4.120.0030.03616.57
5.4.110.0000.04516.68
5.4.100.0070.04616.46
5.4.90.0060.04216.46
5.4.80.0000.06116.45
5.4.70.0030.03716.65
5.4.60.0000.04216.69
5.4.50.0000.04016.57
5.4.40.0110.03216.61
5.4.30.0040.03516.64
5.4.20.0000.04116.56
5.4.10.0030.04116.42
5.4.00.0070.03216.18
5.3.290.0030.03815.53
5.3.280.0070.03515.53
5.3.270.0060.03715.53
5.3.260.0030.03715.53
5.3.250.0040.03915.53
5.3.240.0060.03815.53
5.3.230.0030.03715.53
5.3.220.0090.02915.53
5.3.210.0000.05215.53
5.3.200.0000.03915.53
5.3.190.0000.03915.53
5.3.180.0070.03615.53
5.3.170.0030.03915.53
5.3.160.0030.03915.53
5.3.150.0030.07415.53
5.3.140.0070.03315.53
5.3.130.0000.05015.53
5.3.120.0040.04015.53
5.3.110.0030.03915.53
5.3.100.0000.04015.53
5.3.90.0140.02815.53
5.3.80.0030.03515.53
5.3.70.0060.03215.53
5.3.60.0000.03715.53
5.3.50.0060.04515.53
5.3.40.0040.03515.53
5.3.30.0060.03215.53
5.3.20.0070.03815.53
5.3.10.0030.03215.53
5.3.00.0060.03815.53
5.2.170.0000.04515.53
5.2.160.0070.02815.53
5.2.150.0030.03015.53
5.2.140.0000.04115.53
5.2.130.0030.03115.53
5.2.120.0030.03815.53
5.2.110.0030.03215.53
5.2.100.0000.03415.53
5.2.90.0060.03115.53
5.2.80.0000.05115.53
5.2.70.0000.03115.53
5.2.60.0090.03515.53
5.2.50.0000.03615.53
5.2.40.0040.02915.53
5.2.30.0000.03615.53
5.2.20.0060.02815.53
5.2.10.0030.02715.53
5.2.00.0030.02915.53
5.1.60.0030.02415.53
5.1.50.0030.02615.53
5.1.40.0000.02615.53
5.1.30.0040.03315.53
5.1.20.0070.02715.53
5.1.10.0060.02615.53
5.1.00.0030.02615.53
5.0.50.0000.02815.53
5.0.40.0030.01915.53
5.0.30.0030.03015.53
5.0.20.0000.02115.53
5.0.10.0060.01615.53
5.0.00.0030.03115.53
4.4.90.0030.01415.53
4.4.80.0000.03815.53
4.4.70.0030.01315.53
4.4.60.0040.01415.53
4.4.50.0040.01315.53
4.4.40.0030.02315.53
4.4.30.0000.01815.53
4.4.20.0040.01515.53
4.4.10.0000.01915.53
4.4.00.0000.03115.53
4.3.110.0000.01815.53
4.3.100.0030.01815.53
4.3.90.0000.01715.53
4.3.80.0000.02515.53
4.3.70.0030.01915.53
4.3.60.0000.01715.53
4.3.50.0030.02515.53
4.3.40.0030.02815.53
4.3.30.0000.02615.53
4.3.20.0000.02315.53
4.3.10.0000.01715.53
4.3.00.0060.01815.53

preferences:
46.05 ms | 400 KiB | 5 Q