3v4l.org

run code in 300+ PHP versions simultaneously
<?php function apiEncode($data) { $td = mcrypt_module_open (MCRYPT_3DES, '', MCRYPT_MODE_ECB, ''); //Generate a key from a hash $key = "6702BC24DD0527E7"; //Create init vector //$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ecb), MCRYPT_RAND); //Pad for PKCS7 $blockSize = mcrypt_get_block_size('tripledes', 'ecb'); $len = strlen($data); $pad = $blockSize - ($len % $blockSize); $data .= str_repeat(chr($pad), $pad); $key_add = 24-strlen($key); $key .= substr($key,0,$key_add); // append the first 8 bytes onto the end //Encrypt data //$encData = mcrypt_encrypt('tripledes', $key, $data, 'ecv');//, $iv); //return base64_encode($encData); //mcrypt_generic_init ($td, $key, $iv); $encrypt_text = mcrypt_generic ($td, $text); mcrypt_generic_deinit($td); mcrypt_module_close($td); return $encrypt_text; } $crypt = apiEncode("00010"); echo "CRYPT: $crypt"; //$crypt2 = apiEncode("SimpleTripleDes"); // echo "CRYPT2: $crypt2";

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.0090.00916.62
8.3.50.0170.00718.09
8.3.40.0070.00718.94
8.3.30.0120.00619.01
8.3.20.0080.00020.66
8.3.10.0040.00423.61
8.3.00.0040.00418.76
8.2.180.0100.01018.14
8.2.170.0110.00418.79
8.2.160.0080.00522.96
8.2.150.0030.00624.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.70
8.2.110.0000.00920.99
8.2.100.0090.00319.63
8.2.90.0030.00619.14
8.2.80.0110.00017.97
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00419.88
8.2.30.0000.00718.00
8.2.20.0030.00517.74
8.2.10.0040.00419.66
8.2.00.0050.00318.00
8.1.280.0210.00025.92
8.1.270.0040.00420.27
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00421.37
8.1.230.0110.00022.21
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0040.00417.22
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0000.00918.59
8.1.160.0040.00418.77
8.1.150.0020.00518.63
8.1.140.0070.00317.36
8.1.130.0070.00017.75
8.1.120.0040.00417.23
8.1.110.0000.00717.35
8.1.100.0050.00217.27
8.1.90.0030.00517.19
8.1.80.0040.00417.34
8.1.70.0040.00417.32
8.1.60.0040.00417.48
8.1.50.0000.00717.45
8.1.40.0030.00517.43
8.1.30.0000.00817.48
8.1.20.0050.00317.53
8.1.10.0040.00417.47
8.1.00.0100.00017.37
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0000.00718.28
8.0.270.0000.00717.19
8.0.260.0060.00017.19
8.0.250.0070.00016.90
8.0.240.0000.00717.00
8.0.230.0000.00716.95
8.0.220.0040.00416.88
8.0.210.0040.00416.82
8.0.200.0000.00816.98
8.0.190.0040.00416.96
8.0.180.0040.00416.91
8.0.170.0070.00016.80
8.0.160.0040.00416.96
8.0.150.0030.00316.95
8.0.140.0040.00416.86
8.0.130.0000.00513.36
8.0.120.0080.00016.74
8.0.110.0000.00816.86
8.0.100.0030.00316.72
8.0.90.0040.00416.77
8.0.80.0060.00916.90
8.0.70.0050.00316.92
8.0.60.0050.00316.82
8.0.50.0040.00416.87
8.0.30.0110.00717.06
8.0.20.0090.01017.40
8.0.10.0050.00316.77
8.0.00.0090.00816.65
7.4.330.0070.00015.03
7.4.320.0000.00616.32
7.4.300.0040.00416.50
7.4.290.0040.00416.35
7.4.280.0070.00016.56
7.4.270.0030.00316.34
7.4.260.0000.00716.43
7.4.250.0080.00016.44
7.4.240.0040.00416.45
7.4.230.0070.00016.36
7.4.220.0120.00916.63
7.4.210.0040.01016.56
7.4.200.0070.00016.55
7.4.160.0120.00316.56
7.4.150.0090.01017.40
7.4.140.0070.01217.86
7.4.130.0120.00816.44
7.4.120.0050.01216.47
7.4.110.0130.01016.64
7.4.100.0100.01016.48
7.4.90.0120.00916.41
7.4.80.0040.01419.39
7.4.70.0080.00616.66
7.4.60.0060.00916.51
7.4.50.0040.00416.62
7.4.40.0080.00816.35
7.4.30.0160.00016.48
7.4.10.0040.01516.46
7.4.00.0060.00915.70
7.3.330.0000.00613.27
7.3.320.0030.00313.34
7.3.310.0070.00016.28
7.3.300.0030.00316.18
7.3.290.0060.00016.25
7.3.280.0120.00716.30
7.3.270.0160.00017.40
7.3.260.0110.00616.45
7.3.250.0110.00916.39
7.3.240.0080.01216.57
7.3.230.0030.01516.41
7.3.210.0110.01216.58
7.3.200.0040.01416.20
7.3.190.0090.01516.33
7.3.180.0040.01716.22
7.3.170.0120.00616.47
7.3.160.0160.00016.38
7.3.130.0000.01816.43
7.3.120.0100.01016.40
7.3.110.0070.00716.42
7.3.100.0000.01616.28
7.3.90.0100.00616.21
7.3.80.0000.01516.52
7.3.70.0070.00716.15
7.3.60.0040.01216.14
7.3.50.0030.00616.39
7.3.40.0060.00816.29
7.3.30.0060.00916.36
7.3.20.0100.00318.05
7.3.10.0000.00918.15
7.3.00.0090.00618.09
7.2.330.0110.00816.64
7.2.320.0170.00016.66
7.2.310.0090.00816.32
7.2.300.0100.00716.63
7.2.290.0100.01316.49
7.2.260.0140.00716.57
7.2.250.0100.00716.52
7.2.240.0060.00916.54
7.2.230.0120.00316.54
7.2.220.0070.01016.45
7.2.210.0070.00416.43
7.2.200.0030.00916.29
7.2.190.0040.01116.47
7.2.180.0030.01316.48
7.2.170.0070.01416.51
7.2.160.0070.00716.43
7.2.150.0030.00918.42
7.2.140.0060.00918.13
7.2.130.0000.01118.35
7.2.120.0090.00618.21
7.2.110.0040.01218.20
7.2.100.0100.00318.23
7.2.90.0120.00318.28
7.2.80.0090.00418.21
7.2.70.0070.01018.26
7.2.60.0120.00317.53
7.2.50.0030.01017.49
7.2.40.0000.01418.38
7.2.30.0130.00618.27
7.2.20.0090.00618.40
7.2.10.0080.00618.16
7.2.00.0090.00918.20
7.1.330.0130.00317.27
7.1.320.0080.00817.13
7.1.310.0040.00817.31
7.1.300.0030.01017.36
7.1.290.0120.00017.18
7.1.280.0060.00617.16
7.1.270.0030.01017.18
7.1.260.0030.01317.19
7.1.250.0030.00717.19
7.1.240.0100.00317.25
7.1.230.0030.01217.21
7.1.220.0070.01117.21
7.1.210.0060.01217.13
7.1.200.0020.00916.33
7.1.190.0000.01417.14
7.1.180.0070.00317.01
7.1.170.0080.00417.02
7.1.160.0030.00617.28
7.1.150.0030.01317.29
7.1.140.0060.00617.16
7.1.130.0040.00717.08
7.1.120.0070.00317.15
7.1.110.0060.00317.30
7.1.100.0060.00617.50
7.1.90.0110.00417.26
7.1.80.0060.01017.19
7.1.70.0070.00517.09
7.1.60.0100.01018.25
7.1.50.0050.01016.97
7.1.40.0030.01017.37
7.1.30.0070.00717.31
7.1.20.0100.00617.19
7.1.10.0000.01317.16
7.1.00.0050.04219.75
7.0.330.0090.00317.02
7.0.320.0150.00016.88
7.0.310.0090.00616.94
7.0.300.0030.01016.74
7.0.290.0060.00616.86
7.0.280.0060.00916.93
7.0.270.0070.00616.89
7.0.260.0040.01116.87
7.0.250.0040.00416.98
7.0.240.0060.00816.82
7.0.230.0000.01416.98
7.0.220.0110.00717.04
7.0.210.0070.00716.88
7.0.200.0040.00516.74
7.0.190.0000.01316.93
7.0.180.0120.00616.76
7.0.170.0120.00616.74
7.0.160.0040.00716.89
7.0.150.0030.01016.90
7.0.140.0060.00916.80
7.0.130.0070.00416.96
7.0.120.0030.01017.05
7.0.110.0060.00616.66
7.0.100.0030.00716.79
7.0.90.0060.00916.95
7.0.80.0090.00916.84
7.0.70.0060.00617.03
7.0.60.0150.04118.37
7.0.50.0080.02817.35
7.0.40.0030.02817.64
7.0.30.0200.02717.50
7.0.20.0170.04517.45
7.0.10.0130.04117.41
7.0.00.0080.04717.56
5.6.400.0100.00615.72
5.6.390.0000.01315.69
5.6.380.0060.01215.79
5.6.370.0060.00615.64
5.6.360.0070.00715.40
5.6.350.0000.01615.78
5.6.340.0120.00615.79
5.6.330.0060.00815.75
5.6.320.0000.01115.61
5.6.310.0070.00715.77
5.6.300.0030.01415.91
5.6.290.0080.00415.59
5.6.280.0050.03918.42
5.6.270.0030.01015.80
5.6.260.0130.00315.53
5.6.250.0030.01015.77
5.6.240.0050.00515.69
5.6.230.0040.00715.80
5.6.220.0030.01415.67
5.6.210.0090.03418.23
5.6.200.0130.04116.85
5.6.190.0070.02618.12
5.6.180.0080.04818.03
5.6.170.0200.03918.09
5.6.160.0080.04318.10
5.6.150.0030.03516.79
5.6.140.0060.02316.87
5.6.130.0050.04817.00
5.6.120.0070.02518.32
5.6.110.0080.04918.32
5.6.100.0100.04518.50
5.6.90.0100.04418.30
5.6.80.0030.03517.84
5.6.70.0080.00815.10
5.6.60.0110.00415.57
5.6.50.0040.00815.47
5.6.40.0000.01115.78
5.6.30.0030.01515.56
5.6.20.0070.00715.60
5.6.10.0060.00915.76
5.6.00.0090.00915.45
5.5.380.0120.00315.55
5.5.370.0030.01315.49
5.5.360.0110.00315.58
5.5.350.0130.04217.97
5.5.340.0090.04016.81
5.5.330.0060.02317.95
5.5.320.1370.02517.88
5.5.310.0180.04318.13
5.5.300.0050.03016.84
5.5.290.0090.03216.78
5.5.280.0000.04118.22
5.5.270.0030.04818.17
5.5.260.0060.04818.32
5.5.250.0030.04318.12
5.5.240.0100.04817.67
5.5.230.0040.00815.49
5.5.220.0130.00315.58
5.5.210.0000.01315.52
5.5.200.0090.00615.32
5.5.190.0040.00715.50
5.5.180.0040.01115.38
5.5.170.0060.01215.66
5.5.160.0000.01415.54
5.5.150.0050.00915.61
5.5.140.0060.00315.58
5.5.130.0060.01215.43
5.5.120.0090.00015.44
5.5.110.0030.01015.54
5.5.100.0000.01115.56
5.5.90.0030.01015.35
5.5.80.0070.01115.38
5.5.70.0050.00415.59
5.5.60.0100.01015.64
5.5.50.0080.01115.59
5.5.40.0110.00715.34
5.5.30.0070.01015.57
5.5.20.0080.00615.49
5.5.10.0030.00915.31
5.5.00.0120.00315.36
5.4.450.0070.02516.01
5.4.440.0330.02915.95
5.4.430.0370.04116.05
5.4.420.0120.02715.97
5.4.410.0100.03016.09
5.4.400.0050.03415.80
5.4.390.0130.02715.74
5.4.380.0120.03815.76
5.4.370.0160.03315.78
5.4.360.0090.03915.71
5.4.350.0120.03815.83
5.4.340.0080.04115.91
5.4.330.0070.00712.39
5.4.320.0140.03715.81
5.4.310.0050.03715.77
5.4.300.0080.02715.71
5.4.290.0050.03315.70
5.4.280.0080.02915.82
5.4.270.0080.03315.84
5.4.260.0070.02715.93
5.4.250.0060.03315.91
5.4.240.0100.02915.79
5.4.230.0050.03215.84
5.4.220.0070.03315.83
5.4.210.0070.03415.81
5.4.200.0080.02714.63
5.4.190.0040.03115.82
5.4.180.0050.03315.82
5.4.170.0070.03715.74
5.4.160.0120.02315.82
5.4.150.0070.03015.75
5.4.140.0040.03214.49
5.4.130.0050.03014.53
5.4.120.0050.02714.60
5.4.110.0030.03014.66
5.4.100.0110.02814.53
5.4.90.0050.03214.65
5.4.80.0120.02614.43
5.4.70.0070.02814.38
5.4.60.0080.02714.58
5.4.50.0030.03014.47
5.4.40.0070.02714.39
5.4.30.0080.02714.41
5.4.20.0100.02714.58
5.4.10.0100.02514.54
5.4.00.0070.02714.19
5.3.290.0100.05314.73
5.3.280.0070.05314.66
5.3.270.0030.05714.63
5.3.260.0100.05314.66
5.3.250.0100.05014.51
5.3.240.0100.06714.53
5.3.230.0070.06014.50
5.3.220.0100.05714.68
5.3.210.0070.05714.60
5.3.200.0100.05014.68
5.3.190.0100.05014.52
5.3.180.0100.05014.47
5.3.170.0100.05314.57
5.3.160.0030.06014.47
5.3.150.0030.05714.47
5.3.140.0070.05314.63
5.3.130.0130.05014.69
5.3.120.0130.05314.45
5.3.110.0100.05314.61
5.3.100.0000.06014.15
5.3.90.0100.04714.13
5.3.80.0100.05314.01
5.3.70.0070.05314.08
5.3.60.0070.05314.08
5.3.50.0070.05313.96
5.3.40.0070.05013.95
5.3.30.0130.04314.07
5.3.20.0100.04713.70
5.3.10.0130.04013.61
5.3.00.0030.05713.54
5.2.170.0030.04711.11
5.2.160.0030.04311.09
5.2.150.0070.04011.29
5.2.140.0070.04011.04
5.2.130.0030.04011.09
5.2.120.0030.04311.09
5.2.110.0100.03711.10
5.2.100.0070.04311.25
5.2.90.0030.04311.17
5.2.80.0070.04011.08
5.2.70.0130.03311.16
5.2.60.0100.04311.21
5.2.50.0100.03711.13
5.2.40.0030.04010.85
5.2.30.0030.04710.88
5.2.20.0030.05310.94
5.2.10.0130.04310.76
5.2.00.0070.04310.66
5.1.60.0030.0379.84
5.1.50.0030.0409.99
5.1.40.0000.0409.84
5.1.30.0030.03710.50
5.1.20.0100.03310.41
5.1.10.0030.0379.91
5.1.00.0030.04010.07
5.0.50.0170.0178.60
5.0.40.0100.0238.32
5.0.30.0000.0508.16
5.0.20.0030.0308.36
5.0.10.0030.0338.12
5.0.00.0100.0378.11
4.4.90.0030.0205.93
4.4.80.0000.0235.76
4.4.70.0070.0175.86
4.4.60.0070.0205.76
4.4.50.0030.0205.95
4.4.40.0000.0375.76
4.4.30.0000.0235.76
4.4.20.0070.0175.95
4.4.10.0000.0235.98
4.4.00.0000.0375.93
4.3.110.0000.0235.86
4.3.100.0030.0235.73
4.3.90.0000.0235.68
4.3.80.0000.0375.68
4.3.70.0030.0205.80
4.3.60.0030.0205.68
4.3.50.0030.0205.80
4.3.40.0070.0305.71
4.3.30.0030.0204.45
4.3.20.0030.0204.60
4.3.10.0000.0234.48
4.3.00.0030.02015.77

preferences:
48.13 ms | 401 KiB | 5 Q