3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Security { public static function encrypt($input, $key) { $size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); $input = Security::pkcs5_pad($input, $size); $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $data = mcrypt_generic($td, $input); mcrypt_generic_deinit($td); mcrypt_module_close($td); $data = base64_encode($data); return $data; } private static function pkcs5_pad ($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); return $text . str_repeat(chr($pad), $pad); } public static function decrypt($sStr, $sKey) { $decrypted= mcrypt_decrypt( MCRYPT_RIJNDAEL_128, $sKey, base64_decode($sStr), MCRYPT_MODE_ECB ); $dec_s = strlen($decrypted); $padding = ord($decrypted[$dec_s-1]); $decrypted = substr($decrypted, 0, -$padding); return $decrypted; } } $value = "B0585788"; $key = "1234567891234567"; //16 Character Key echo Security::encrypt($value, $key); echo Security::decrypt(Security::encrypt($value, $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.0070.00716.50
8.3.50.0190.00721.10
8.3.40.0110.00718.84
8.3.30.0140.00418.82
8.3.20.0030.00520.24
8.3.10.0050.00323.66
8.3.00.0090.00919.69
8.2.180.0130.00318.66
8.2.170.0040.01122.96
8.2.160.0090.00920.36
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0030.00617.50
8.2.110.0030.00622.08
8.2.100.0030.01017.75
8.2.90.0000.00819.05
8.2.80.0000.00917.97
8.2.70.0000.00817.25
8.2.60.0080.00017.80
8.2.50.0030.00518.07
8.2.40.0040.00419.39
8.2.30.0030.00518.00
8.2.20.0000.00817.57
8.2.10.0080.00018.01
8.2.00.0040.00418.13
8.1.280.0040.01125.92
8.1.270.0100.00620.41
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.30
8.1.230.0060.00617.42
8.1.220.0060.00617.74
8.1.210.0060.00318.77
8.1.200.0090.00017.23
8.1.190.0080.00017.13
8.1.180.0000.00818.10
8.1.170.0030.00518.51
8.1.160.0080.00021.84
8.1.150.0040.00418.75
8.1.140.0050.00317.34
8.1.130.0040.00417.69
8.1.120.0040.00417.46
8.1.110.0000.00817.29
8.1.100.0040.00417.48
8.1.90.0090.00017.44
8.1.80.0040.00417.28
8.1.70.0030.00317.39
8.1.60.0050.00317.55
8.1.50.0000.00817.54
8.1.40.0040.00417.49
8.1.30.0050.00317.57
8.1.20.0060.00317.52
8.1.10.0040.00417.64
8.1.00.0050.00317.53
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0000.00818.41
8.0.270.0030.00317.08
8.0.260.0000.00617.20
8.0.250.0040.00416.85
8.0.240.0040.00417.01
8.0.230.0030.00316.89
8.0.220.0070.00016.78
8.0.210.0040.00416.92
8.0.200.0030.00316.83
8.0.190.0000.00817.01
8.0.180.0050.00216.91
8.0.170.0090.00016.89
8.0.160.0040.00416.91
8.0.150.0030.00316.84
8.0.140.0040.00416.89
8.0.130.0060.00013.36
8.0.120.0000.00916.88
8.0.110.0070.00016.88
8.0.100.0000.00716.76
8.0.90.0000.00816.89
8.0.80.0100.00916.89
8.0.70.0040.00416.75
8.0.60.0070.00016.97
8.0.50.0040.00416.68
8.0.30.0080.01017.00
8.0.20.0110.00817.40
8.0.10.0000.00716.84
8.0.00.0120.00616.73
7.4.330.0020.00215.08
7.4.320.0030.00316.48
7.4.300.0000.00616.60
7.4.290.0030.00316.61
7.4.280.0050.00216.49
7.4.270.0070.00016.64
7.4.260.0030.00316.50
7.4.250.0080.00016.50
7.4.240.0040.00416.52
7.4.230.0000.00716.72
7.4.220.0030.01216.55
7.4.210.0120.00816.61
7.4.200.0000.00716.62
7.4.160.0140.00716.51
7.4.150.0120.00617.40
7.4.140.0130.01017.86
7.4.130.0150.00316.52
7.4.120.0060.01116.59
7.4.110.0140.01016.49
7.4.100.0100.01016.61
7.4.90.0100.01316.66
7.4.80.0130.00319.39
7.4.70.0090.01016.63
7.4.60.0120.01216.73
7.4.50.0040.00416.47
7.4.40.0070.01016.54
7.4.30.0070.01716.55
7.4.00.0040.01214.68
7.3.330.0000.00713.25
7.3.320.0050.00013.19
7.3.310.0070.00016.24
7.3.300.0030.00316.43
7.3.290.0100.00816.36
7.3.280.0130.00616.37
7.3.270.0100.00717.40
7.3.260.0210.00316.36
7.3.250.0100.00916.44
7.3.240.0090.00916.25
7.3.230.0100.00716.39
7.3.210.0060.01316.31
7.3.200.0130.00316.31
7.3.190.0090.00616.62
7.3.180.0070.01416.26
7.3.170.0100.00616.54
7.3.160.0100.01016.33
7.3.10.0040.00916.55
7.3.00.0090.00616.56
7.2.330.0080.01116.62
7.2.320.0080.01216.62
7.2.310.0100.00716.66
7.2.300.0060.01216.65
7.2.290.0030.02016.25
7.2.130.0000.01116.81
7.2.120.0030.01016.49
7.2.110.0030.00916.74
7.2.100.0040.01116.52
7.2.90.0080.00416.78
7.2.80.0030.00916.58
7.2.70.0030.01216.74
7.2.60.0040.00916.77
7.2.50.0000.01316.83
7.2.40.0040.01316.76
7.2.30.0080.00816.77
7.2.20.0120.00016.88
7.2.10.0070.00716.67
7.2.00.0010.01017.81
7.1.250.0060.00315.36
7.1.200.0070.00715.82
7.1.100.0060.00617.69
7.1.70.0050.00216.96
7.1.60.0090.01520.03
7.1.50.0090.01516.97
7.1.00.0070.08722.40
7.0.200.0350.00414.64
7.0.100.0030.05020.03
7.0.90.0070.05019.94
7.0.80.0030.05720.09
7.0.70.0130.05719.95
7.0.60.0230.07319.96
7.0.50.0230.03720.23
7.0.40.0130.04320.11
7.0.30.0030.09320.07
7.0.20.0130.07719.98
7.0.10.0070.07020.13
7.0.00.0070.08020.06
5.6.280.0070.03320.94
5.6.250.0030.07720.60
5.6.240.0070.04720.68
5.6.230.0030.05720.70
5.6.220.0030.05020.68
5.6.210.0100.05020.65
5.6.200.0100.04721.19
5.6.190.0100.06721.05
5.6.180.0100.09021.02
5.6.170.0100.08321.05
5.6.160.0200.07021.19
5.6.150.0070.09321.07
5.6.140.0100.08021.18
5.6.130.0030.05721.00
5.6.120.0000.07321.04
5.6.110.0070.07721.20
5.6.100.0030.09321.03
5.6.90.0130.07021.06
5.6.80.0130.03320.45
5.6.70.0030.07320.56
5.6.60.0170.05020.41
5.6.50.0130.05320.40
5.6.40.0030.04720.54
5.6.30.0230.02320.41
5.6.20.0000.04720.50
5.6.10.0130.03720.48
5.6.00.0030.04320.40
5.5.380.0070.04020.45
5.5.370.0100.04320.43
5.5.360.0130.07320.42
5.5.350.0200.06720.36
5.5.340.0000.05320.85
5.5.330.0030.09720.81
5.5.320.0070.07320.92
5.5.310.0100.05320.86
5.5.300.0100.07020.89
5.5.290.0070.04720.63
5.5.280.0100.07720.93
5.5.270.0030.08720.84
5.5.260.0100.05020.83
5.5.250.0070.08720.80
5.5.240.0100.04020.38
5.5.230.0000.05020.22
5.5.220.0030.05020.34
5.5.210.0070.04020.06
5.5.200.0030.04320.17
5.5.190.0030.04020.22
5.5.180.0030.04020.19
5.5.160.0000.04720.29
5.5.150.0070.04320.23
5.5.140.0030.04020.17
5.5.130.0030.03720.27
5.5.120.0000.03720.18
5.5.110.0030.04720.22
5.5.100.0000.04320.21
5.5.90.0000.04020.13
5.5.80.0030.04020.11
5.5.70.0070.03720.16
5.5.60.0070.04320.25
5.5.50.0000.05020.11
5.5.40.0000.05320.07
5.5.30.0130.03020.11
5.5.20.0130.03320.13
5.5.10.0170.02320.17
5.5.00.0000.04320.09
5.4.450.0030.04319.46
5.4.440.0130.04019.49
5.4.430.0070.04719.46
5.4.420.0100.05019.45
5.4.410.0130.06719.28
5.4.400.0070.07319.05
5.4.390.0030.06719.24
5.4.380.0100.04019.13
5.4.370.0170.05718.94
5.4.360.0130.06719.20
5.4.350.0030.04018.91
5.4.340.0000.04319.16
5.4.320.0070.03319.14
5.4.310.0070.03719.05
5.4.300.0030.03719.18
5.4.290.0070.05019.13
5.4.280.0070.03318.91
5.4.270.0030.03719.23
5.4.260.0070.04019.06
5.4.250.0000.04719.02
5.4.240.0000.04019.07
5.4.230.0030.06019.09
5.4.220.0030.03318.90
5.4.210.0030.03319.23
5.4.200.0030.03719.14
5.4.190.0030.04019.07
5.4.180.0000.04318.98
5.4.170.0000.04018.94
5.4.160.0000.04018.89
5.4.150.0070.03719.02
5.4.140.0000.04016.42
5.4.130.0100.03016.55
5.4.120.0130.02716.45
5.4.110.0030.04316.45
5.4.100.0070.03716.40
5.4.90.0030.03716.57
5.4.80.0000.03716.46
5.4.70.0000.03716.55
5.4.60.0070.03316.54
5.4.50.0070.04316.41
5.4.40.0000.04016.40
5.4.30.0100.03016.35
5.4.20.0000.04316.48
5.4.10.0030.03016.53
5.4.00.0030.03315.93

preferences:
73.44 ms | 401 KiB | 5 Q