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 = "2234567891234567"; //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.70.0160.00018.56
8.3.60.0140.00716.75
8.3.50.0210.00921.16
8.3.40.0150.00418.64
8.3.30.0060.01018.79
8.3.20.0040.00420.34
8.3.10.0040.00423.67
8.3.00.0080.00019.78
8.2.180.0160.00718.30
8.2.170.0070.00722.96
8.2.160.0130.00320.35
8.2.150.0030.00524.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00817.50
8.2.110.0000.00822.11
8.2.100.0030.00917.78
8.2.90.0030.00519.22
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0090.00017.80
8.2.50.0030.00618.07
8.2.40.0040.00419.29
8.2.30.0020.00518.13
8.2.20.0040.00417.62
8.2.10.0040.00418.07
8.2.00.0040.00418.05
8.1.280.0120.00325.92
8.1.270.0090.00620.29
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00022.01
8.1.230.0090.00322.81
8.1.220.0100.00017.74
8.1.210.0050.00318.77
8.1.200.0060.00317.36
8.1.190.0080.00017.25
8.1.180.0030.00618.10
8.1.170.0080.00018.61
8.1.160.0000.00721.88
8.1.150.0040.00418.84
8.1.140.0000.00817.46
8.1.130.0030.00317.61
8.1.120.0020.00517.30
8.1.110.0000.00817.44
8.1.100.0060.00317.47
8.1.90.0040.00417.39
8.1.80.0000.00717.39
8.1.70.0030.00317.40
8.1.60.0040.00417.50
8.1.50.0000.00817.56
8.1.40.0000.00817.39
8.1.30.0040.00417.64
8.1.20.0000.00817.73
8.1.10.0050.00217.50
8.1.00.0040.00417.41
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0070.00018.28
8.0.270.0030.00317.20
8.0.260.0000.00617.07
8.0.250.0000.00816.84
8.0.240.0030.00316.83
8.0.230.0040.00416.80
8.0.220.0000.00716.92
8.0.210.0070.00016.91
8.0.200.0000.00716.92
8.0.190.0030.00616.99
8.0.180.0000.00716.82
8.0.170.0000.00816.96
8.0.160.0040.00416.91
8.0.150.0000.00716.84
8.0.140.0000.00816.87
8.0.130.0030.00313.42
8.0.120.0050.00316.89
8.0.110.0030.00516.89
8.0.100.0040.00416.84
8.0.90.0000.00816.91
8.0.80.0000.01516.87
8.0.70.0040.00416.79
8.0.60.0040.00416.86
8.0.50.0000.00716.68
8.0.30.0090.00716.93
8.0.20.0100.00817.41
8.0.10.0040.00417.04
8.0.00.0100.00816.72
7.4.330.0000.00515.08
7.4.320.0030.00316.53
7.4.300.0030.00316.50
7.4.290.0070.00016.51
7.4.280.0030.00516.62
7.4.270.0030.00316.49
7.4.260.0070.00016.66
7.4.250.0040.00416.42
7.4.240.0030.00516.61
7.4.230.0000.00816.63
7.4.220.0120.00916.51
7.4.210.0100.00616.71
7.4.200.0030.00316.42
7.4.160.0080.00816.33
7.4.150.0090.00917.40
7.4.140.0120.00717.86
7.4.130.0070.01116.54
7.4.120.0110.00916.60
7.4.110.0100.00616.64
7.4.100.0100.00916.63
7.4.90.0120.00616.46
7.4.80.0060.01119.39
7.4.70.0060.01216.51
7.4.60.0060.01216.57
7.4.50.0080.00016.61
7.4.40.0120.00616.24
7.4.30.0030.02016.42
7.4.10.0070.01015.05
7.4.00.0040.01114.97
7.3.330.0000.00713.20
7.3.320.0030.00313.31
7.3.310.0070.00016.37
7.3.300.0070.00016.37
7.3.290.0090.00916.40
7.3.280.0100.00816.40
7.3.270.0070.01017.40
7.3.260.0150.01116.20
7.3.250.0130.00416.51
7.3.240.0030.01516.48
7.3.230.0090.01016.56
7.3.210.0140.00316.66
7.3.200.0120.00616.22
7.3.190.0100.00616.57
7.3.180.0070.01316.50
7.3.170.0100.01016.38
7.3.160.0090.00616.50
7.3.130.0100.01014.79
7.3.120.0100.00714.71
7.3.110.0030.01114.67
7.3.100.0040.01214.96
7.3.90.0030.00614.78
7.3.80.0060.00614.89
7.3.70.0020.00714.75
7.3.60.0040.00714.87
7.3.50.0040.00914.74
7.3.40.0050.00614.51
7.3.30.0090.00314.95
7.3.20.0050.01116.42
7.3.10.0080.00816.65
7.3.00.0070.00516.64
7.2.330.0040.01516.61
7.2.320.0180.00016.30
7.2.310.0100.01016.45
7.2.300.0070.01016.57
7.2.290.0070.01016.43
7.2.260.0060.01215.13
7.2.250.0060.01115.12
7.2.240.0090.00815.00
7.2.230.0030.01214.99
7.2.220.0020.01514.69
7.2.210.0030.01014.88
7.2.200.0050.00714.91
7.2.190.0050.01014.82
7.2.180.0060.00514.95
7.2.170.0060.00614.98
7.2.160.0070.00814.99
7.2.150.0080.00716.74
7.2.140.0090.00416.78
7.2.130.0040.00816.70
7.2.120.0080.00616.74
7.2.110.0070.00816.74
7.2.100.0090.00716.60
7.2.90.0070.00716.85
7.2.80.0060.01016.85
7.2.70.0040.01216.68
7.2.60.0070.00716.67
7.2.50.0080.00716.84
7.2.40.0080.00416.75
7.2.30.0070.00716.87
7.2.20.0090.00516.78
7.2.10.0050.00816.81
7.2.00.0100.00417.45
7.1.330.0050.01215.58
7.1.320.0100.00815.63
7.1.310.0020.01415.75
7.1.300.0050.00915.54
7.1.290.0050.01015.77
7.1.280.0000.01515.61
7.1.270.0080.00515.41
7.1.260.0030.01015.63
7.1.250.0020.01015.75
7.1.240.0020.01015.56
7.1.230.0050.00815.70
7.1.220.0090.00615.75
7.1.210.0050.00915.55
7.1.200.0090.00515.64
7.1.190.0020.01315.53
7.1.180.0060.00715.62
7.1.170.0050.00715.69
7.1.160.0040.00815.60
7.1.150.0020.00915.73
7.1.140.0030.00815.62
7.1.130.0090.00315.67
7.1.120.0060.00615.68
7.1.110.0050.00515.62
7.1.100.0040.01016.33
7.1.90.0090.00615.70
7.1.80.0050.00715.76
7.1.70.0090.00516.00
7.1.60.0080.00917.15
7.1.50.0050.01015.97
7.1.40.0050.00715.69
7.1.30.0080.00615.52
7.1.20.0040.01015.71
7.1.10.0050.00715.63
7.1.00.0050.03317.86
7.0.330.0050.00915.33
7.0.320.0050.00915.35
7.0.310.0050.00715.21
7.0.300.0050.00915.40
7.0.290.0020.01015.33
7.0.280.0030.01015.32
7.0.270.0050.00915.30
7.0.260.0070.00515.27
7.0.250.0070.00715.44
7.0.240.0020.00815.32
7.0.230.0040.00815.27
7.0.220.0070.00515.26
7.0.210.0080.00515.37
7.0.200.0110.00915.05
7.0.190.0030.00815.40
7.0.180.0030.00715.25
7.0.170.0050.00715.29
7.0.160.0060.00615.29
7.0.150.0030.00815.20
7.0.140.0020.00815.28
7.0.130.0100.00115.26
7.0.120.0040.00815.34
7.0.110.0040.00915.23
7.0.100.0020.01115.18
7.0.90.0020.00815.41
7.0.80.0070.00615.00
7.0.70.0080.00515.29
7.0.60.0040.03516.77
7.0.50.0030.02316.33
7.0.40.0060.03215.71
7.0.30.0120.02915.67
7.0.20.0140.03015.61
7.0.10.0080.03315.68
7.0.00.0070.03115.67
5.6.400.0040.00714.23
5.6.390.0070.00714.42
5.6.380.0020.01214.43
5.6.370.0050.01014.26
5.6.360.0030.01014.18
5.6.350.0040.00914.45
5.6.340.0060.00414.39
5.6.330.0060.00514.33
5.6.320.0030.00714.39
5.6.310.0070.00714.29
5.6.300.0090.00514.25
5.6.290.0030.01114.17
5.6.280.0050.01616.36
5.6.270.0060.00814.33
5.6.260.0110.00414.31
5.6.250.0020.01114.24
5.6.240.0050.01014.04
5.6.230.0050.00914.14
5.6.220.0070.00814.29
5.6.210.0100.02116.38
5.6.200.0110.02315.71
5.6.190.0020.03216.43
5.6.180.1150.01916.31
5.6.170.0070.02516.21
5.6.160.0040.03716.37
5.6.150.0050.03615.53
5.6.140.0040.01915.61
5.6.130.0060.02015.66
5.6.120.0050.03316.60
5.6.110.0070.02916.52
5.6.100.0090.02916.47
5.6.90.0030.02016.37
5.6.80.0080.03116.19
5.6.70.1530.01916.25
5.6.60.0070.00814.18
5.6.50.0100.00514.33
5.6.40.0090.00514.06
5.6.30.0030.01414.08
5.6.20.0040.00914.14
5.6.10.0050.00614.20
5.6.00.0080.00314.21
5.5.380.0020.01214.25
5.5.370.0060.00614.14
5.5.360.0060.00614.13
5.5.350.0090.03216.24
5.5.340.0110.02815.29
5.5.330.0100.03216.13
5.5.320.0190.02016.43
5.5.310.0130.01816.06
5.5.300.0070.01715.42
5.5.290.0070.02815.50
5.5.280.0100.02816.50
5.5.270.0070.01916.30
5.5.260.0110.03116.34
5.5.250.0080.01916.38
5.5.240.0120.02316.12
5.5.230.0070.00814.23
5.5.220.0090.00414.03
5.5.210.0040.00913.89
5.5.200.0020.01113.99
5.5.190.0080.00914.07
5.5.180.0080.00614.11
5.5.170.0080.00514.13
5.5.160.0100.00314.01
5.5.150.0050.01014.13
5.5.140.0020.01314.01
5.5.130.0060.00314.26
5.5.120.0060.00413.95
5.5.110.0050.01014.02
5.5.100.0050.00814.09
5.5.90.0050.00814.07
5.5.80.0030.01013.95
5.5.70.0050.00613.93
5.5.60.0070.00414.13
5.5.50.0070.00613.97
5.5.40.0070.00614.01
5.5.30.0070.00814.14
5.5.20.0080.00714.20
5.5.10.0060.00814.09
5.5.00.0090.00314.05
5.4.450.0110.02614.32
5.4.440.0050.02614.33
5.4.430.0110.02114.24
5.4.420.0230.02414.46
5.4.410.0080.02114.19
5.4.400.0140.01614.23
5.4.390.0150.02114.26
5.4.380.0100.02014.14
5.4.370.0150.01614.13
5.4.360.0130.01814.15
5.4.350.0080.02214.16
5.4.340.0120.01714.18
5.4.330.0060.00211.64
5.4.320.0110.02514.28
5.4.310.0070.02714.15
5.4.300.0060.02114.09
5.4.290.0050.02314.11
5.4.280.0130.02014.32
5.4.270.0090.02114.17
5.4.260.0080.02214.16
5.4.250.0090.02214.14
5.4.240.0110.01914.21
5.4.230.0080.02214.27
5.4.220.0090.02414.06
5.4.210.0050.02614.17
5.4.200.0120.01614.20
5.4.190.0130.02714.17
5.4.180.0050.02014.24
5.4.170.0120.01814.16
5.4.160.0050.02814.09
5.4.150.0030.02414.27
5.4.140.0090.02013.34
5.4.130.0110.01913.32
5.4.120.0120.01613.49
5.4.110.0100.02313.38
5.4.100.0080.02013.38
5.4.90.0060.02013.31
5.4.80.0090.02013.31
5.4.70.0030.01813.31
5.4.60.0090.02213.18
5.4.50.0060.02313.22
5.4.40.0120.02513.33
5.4.30.0120.02013.36
5.4.20.0100.01713.40
5.4.10.0050.00511.70
5.4.00.0000.01111.78

preferences:
51.84 ms | 401 KiB | 5 Q