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)
5.6.100.0000.04720.96
5.6.90.0100.07320.97
5.6.80.0100.08020.51
5.5.260.0070.08720.75
5.5.250.0100.07720.78
5.5.240.0000.07720.12
5.4.420.0130.05319.43
5.4.410.0100.05319.28
5.4.400.0100.05318.92
5.4.390.0000.06019.12
5.4.380.0100.05319.16
5.4.370.0170.04718.97
5.4.360.0070.05318.99
5.4.350.0200.04319.09
5.4.340.0200.04019.08
5.4.320.0100.05319.15
5.4.310.0030.06019.11
5.4.300.0030.06019.26
5.4.290.0000.06019.21
5.4.280.0070.05319.08
5.4.270.0100.05319.15
5.4.260.0200.04318.99
5.4.250.0000.06319.12
5.4.240.0130.05019.11
5.4.230.0100.05319.03
5.4.220.0100.05319.20
5.4.210.0170.04719.14
5.4.200.0100.05016.71
5.4.190.0130.05319.25
5.4.180.0100.05719.14
5.4.170.0030.06019.05
5.4.160.0100.05319.09
5.4.150.0130.05019.11
5.4.140.0200.06016.49
5.4.130.0130.05716.58
5.4.120.0200.04316.59
5.4.110.0070.06316.35
5.4.100.0100.06316.48
5.4.90.0100.05316.28
5.4.80.0130.06016.43
5.4.70.0200.04016.55
5.4.60.0200.05316.38
5.4.50.0130.04716.32
5.4.40.0130.05016.22
5.4.30.0170.04316.43
5.4.20.0200.06016.54
5.4.10.0030.05316.54
5.4.00.0000.05715.64
5.3.290.0100.05714.58
5.3.280.0100.06714.67
5.3.270.0030.06714.51
5.3.260.0100.06714.62
5.3.250.0100.05014.68
5.3.240.0070.06714.52
5.3.230.0030.07014.77
5.3.220.0100.06314.47
5.3.210.0100.05314.56
5.3.200.0070.05314.68
5.3.190.0200.04314.63
5.3.180.0130.04714.73
5.3.170.0170.04314.57
5.3.160.0100.05314.73
5.3.150.0070.05714.57
5.3.140.0130.05014.45
5.3.130.0200.05014.56
5.3.120.0030.06714.46
5.3.110.0100.05314.61
5.3.100.0200.04314.07
5.3.90.0030.06013.93
5.3.80.0130.05714.16
5.3.70.0130.04713.91
5.3.60.0200.04013.92
5.3.50.0270.03013.88
5.3.40.0170.04313.91
5.3.30.0030.05313.82
5.3.20.0030.05713.72
5.3.10.0070.05313.57
5.3.00.0030.05313.64
5.2.170.0030.04311.05
5.2.160.0000.04711.13
5.2.150.0030.04711.15
5.2.140.0070.04311.04
5.2.130.0030.04311.09
5.2.120.0070.04311.24
5.2.110.0100.03711.00
5.2.100.0100.03711.03
5.2.90.0030.04311.07
5.2.80.0070.04011.08
5.2.70.0130.05011.08
5.2.60.0100.03710.95
5.2.50.0000.04711.16
5.2.40.0100.03711.15
5.2.30.0000.04710.84
5.2.20.0100.03711.11
5.2.10.0070.04011.01
5.2.00.0030.04310.62
5.1.60.0000.0409.88
5.1.50.0070.0339.93
5.1.40.0030.03710.03
5.1.30.0070.03310.35
5.1.20.0070.03710.26
5.1.10.0100.03010.10
5.1.00.0130.0309.96
5.0.50.0070.0378.44
5.0.40.0030.0278.51
5.0.30.0030.0438.14
5.0.20.0070.0278.20
5.0.10.0070.0278.27
5.0.00.0070.0408.09
4.4.90.0030.0205.76
4.4.80.0030.0205.89
4.4.70.0000.0235.77
4.4.60.0030.0205.93
4.4.50.0030.0205.93
4.4.40.0070.0305.88
4.4.30.0030.0205.93
4.4.20.0070.0205.96
4.4.10.0000.0235.96
4.4.00.0030.0405.93
4.3.110.0030.0205.80
4.3.100.0030.0205.81
4.3.90.0030.0205.65
4.3.80.0030.0335.75
4.3.70.0030.0205.78
4.3.60.0030.0205.64
4.3.50.0000.0235.76
4.3.40.0000.0375.73
4.3.30.0000.0234.55
4.3.20.0030.0204.40
4.3.10.0030.0204.35
4.3.00.0030.01315.77

preferences:
148.62 ms | 1398 KiB | 7 Q