3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'secret'; $input = 'My secret string!'; $iv = NULL; // MCrypt $handle = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_ECB, ''); // PKCS#7 padding //$bsize = mcrypt_enc_get_block_size($handle); //$pad = $bsize - (strlen($input) % $bsize); //$input .= str_repeat(chr($pad), $pad); // IV //$ivsize = mcrypt_enc_get_iv_size($handle); //$iv = mcrypt_create_iv($ivsize, MCRYPT_DEV_URANDOM); // Encrypt mcrypt_generic_init($handle, $key, $iv); $output = mcrypt_generic($handle, $input); mcrypt_generic_deinit($handle); mcrypt_module_close($handle); echo "MCrypt:\n", // "\tIV: ", bin2hex($iv), " (", $ivsize, " bytes)\n", "\tInput: ", bin2hex($input), "\n", "\tOutput: ", bin2hex($output), "\n\n"; //$output = $iv.$output; // OpenSSL // IV //$ivsize = openssl_cipher_iv_length('bf-ecb'); //$iv = substr($output, 0, $ivsize); //$output = substr($output, $ivsize); $input = openssl_decrypt($output, 'bf-ecb', $key, OPENSSL_RAW_DATA, $iv); echo "OpenSSL:\n", // "\tIV: ", bin2hex($iv), " (", $ivsize, " bytes)\n", "\tOutput: ", bin2hex($output), "\n", "\tInput: ", bin2hex($input), "\n\n"; empty($input) && var_dump(openssl_error_string());

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.0060.01218.31
8.3.50.0110.00821.14
8.3.40.0150.00018.97
8.3.30.0040.01120.38
8.3.20.0080.00020.30
8.3.10.0080.00022.04
8.3.00.0040.00422.33
8.2.180.0120.00316.50
8.2.170.0110.00422.96
8.2.160.0070.00722.26
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0030.00526.16
8.2.120.0050.00319.36
8.2.110.0060.00320.51
8.2.100.0040.00717.91
8.2.90.0030.00619.08
8.2.80.0080.00019.32
8.2.70.0040.00417.63
8.2.60.0060.00317.93
8.2.50.0030.00518.07
8.2.40.0040.00417.91
8.2.30.0040.00418.11
8.2.20.0000.00817.72
8.2.10.0000.00717.76
8.2.00.0050.00217.85
8.1.280.0200.00025.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00922.14
8.1.230.0070.00419.01
8.1.220.0000.00717.74
8.1.210.0000.00918.77
8.1.200.0040.00417.35
8.1.190.0040.00417.43
8.1.180.0000.00818.10
8.1.170.0000.00818.48
8.1.160.0040.00418.86
8.1.150.0050.00318.50
8.1.140.0070.00017.30
8.1.130.0070.00017.88
8.1.120.0040.00417.43
8.1.110.0040.00417.42
8.1.100.0000.00717.37
8.1.90.0090.00017.48
8.1.80.0040.00317.43
8.1.70.0000.00717.35
8.1.60.0000.00917.48
8.1.50.0000.00717.50
8.1.40.0060.00317.41
8.1.30.0000.00717.54
8.1.20.0030.00617.59
8.1.10.0040.00417.63
8.1.00.0040.00417.37
8.0.300.0000.00718.77
8.0.290.0000.00716.93
8.0.280.0030.00518.27
8.0.270.0000.00717.18
8.0.260.0000.00716.74
8.0.250.0000.00717.04
8.0.240.0040.00416.88
8.0.230.0030.00316.95
8.0.220.0040.00416.91
8.0.210.0070.00016.80
8.0.200.0000.00616.97
8.0.190.0020.00516.98
8.0.180.0000.00816.83
8.0.170.0000.00816.84
8.0.160.0030.00316.87
8.0.150.0040.00416.75
8.0.140.0050.00316.93
8.0.130.0000.00513.27
8.0.120.0000.00716.98
8.0.110.0050.00316.88
8.0.100.0040.00416.93
8.0.90.0040.00316.96
8.0.80.0100.00616.80
8.0.70.0040.00416.98
8.0.60.0000.00716.90
8.0.50.0000.00716.87
8.0.30.0110.00717.03
8.0.20.0090.00917.41
8.0.10.0040.00417.02
8.0.00.0140.00316.70
7.4.330.0030.00315.00
7.4.320.0030.00316.47
7.4.300.0000.00816.54
7.4.290.0000.00716.58
7.4.280.0070.00016.46
7.4.270.0000.00716.66
7.4.260.0080.00013.31
7.4.250.0050.00316.53
7.4.240.0030.00416.58
7.4.230.0000.00816.56
7.4.220.0090.00916.66
7.4.210.0060.01216.61
7.4.200.0030.00316.51
7.4.190.0000.00716.68
7.4.160.0090.00616.46
7.4.150.0110.00717.40
7.4.140.0130.00817.86
7.4.130.0070.01116.50
7.4.120.0110.01116.64
7.4.110.0120.00616.50
7.4.100.0060.01916.74
7.4.90.0100.00716.30
7.4.80.0040.01519.39
7.4.70.0030.01316.47
7.4.60.0090.00616.52
7.4.50.0040.00416.16
7.4.40.0040.01222.77
7.4.30.0200.00316.65
7.4.00.0080.00614.98
7.3.330.0020.00213.19
7.3.320.0060.00013.07
7.3.310.0040.00416.34
7.3.300.0070.00016.32
7.3.290.0120.00316.31
7.3.280.0100.00816.29
7.3.270.0110.00717.40
7.3.260.0110.00716.30
7.3.250.0110.00916.23
7.3.240.0090.00916.31
7.3.230.0160.00316.39
7.3.210.0110.00716.29
7.3.200.0110.00719.39
7.3.190.0070.01516.41
7.3.180.0030.01216.72
7.3.170.0070.01016.48
7.3.160.0140.00716.52
7.3.120.0090.00914.61
7.3.110.0110.00714.77
7.3.100.0090.00914.53
7.3.90.0170.00014.86
7.3.80.0060.01214.82
7.3.70.0060.01314.59
7.3.60.0080.00814.60
7.3.50.0030.01014.84
7.3.40.0030.01014.67
7.3.30.0110.00414.54
7.3.20.0000.01516.52
7.3.10.0040.00816.53
7.3.00.0040.00716.58
7.2.330.0090.00916.54
7.2.320.0150.00716.50
7.2.310.0070.01416.26
7.2.300.0190.00316.32
7.2.290.0060.01316.45
7.2.250.0060.01314.91
7.2.240.0030.01714.82
7.2.230.0060.01014.80
7.2.220.0110.00715.07
7.2.210.0040.01114.92
7.2.200.0070.01114.82
7.2.190.0110.00414.70
7.2.180.0030.00714.91
7.2.170.0080.00414.88
7.2.130.0000.01416.71
7.2.120.0030.01016.49
7.2.110.0130.00316.81
7.2.100.0070.00416.63
7.2.90.0000.01516.77
7.2.80.0060.00616.58
7.2.70.0000.01216.68
7.2.60.0040.00916.73
7.2.50.0030.00616.61
7.2.40.0060.00616.79
7.2.30.0090.00616.59
7.2.20.0100.00316.87
7.2.10.0030.01016.60
7.2.00.0000.01516.84
7.1.330.0060.00915.64
7.1.320.0090.00315.57
7.1.310.0080.00415.52
7.1.300.0050.00415.64
7.1.290.0060.00915.70
7.1.280.0040.01115.40
7.1.270.0100.00315.72
7.1.260.0030.01215.28
7.1.250.0000.01115.65
7.1.200.0060.00315.64
7.1.70.0030.00717.01
7.1.60.0100.01319.32
7.1.50.0100.01316.83
7.1.00.0070.03722.45
7.0.200.0200.00314.80
7.0.140.0000.07322.11
7.0.100.0230.04020.02
7.0.90.0130.07719.98
7.0.80.0100.06720.16
7.0.70.0300.07719.91
7.0.60.0170.07019.91
7.0.50.0100.07320.45
7.0.40.0100.08320.17
7.0.30.0070.08320.17
7.0.20.0070.08720.09
7.0.10.0030.08020.23
7.0.00.0100.03720.30
5.6.280.0030.07320.86
5.6.250.0200.07320.59
5.6.240.0170.06320.61
5.6.230.0070.08320.66
5.6.220.0200.07020.61
5.6.210.0030.05020.60
5.6.200.0200.08021.16
5.6.190.0100.07021.24
5.6.180.0100.06021.04
5.6.170.0170.06721.07
5.6.160.0130.07021.06
5.6.150.0100.06721.09
5.6.140.0270.05321.14
5.6.130.0100.07721.09
5.6.120.0000.08321.14
5.6.110.0170.07721.27
5.6.100.0100.06721.29
5.6.90.0030.06721.26
5.6.80.0130.06320.45
5.6.70.0070.07320.48
5.6.60.0000.05320.51
5.6.50.0000.08020.62
5.6.40.0170.05020.53
5.6.30.0130.05020.59
5.6.20.0000.05720.58
5.6.10.0070.08020.50
5.6.00.0200.07020.61
5.5.380.0030.07720.50
5.5.370.0100.08020.40
5.5.360.0030.08720.45
5.5.350.0070.05320.46
5.5.340.0130.06721.00
5.5.330.0070.08020.94
5.5.320.0070.04320.91
5.5.310.0030.05321.00
5.5.300.0130.06320.88
5.5.290.0100.04721.01
5.5.280.0100.08020.78
5.5.270.0200.04021.00
5.5.260.0100.08320.97
5.5.250.0070.06320.88
5.5.240.0100.06720.32
5.5.230.0070.07020.36
5.5.220.0100.06320.36
5.5.210.0030.05320.47
5.5.200.0100.07720.33
5.5.190.0230.06320.28
5.5.180.0170.04020.35
5.5.160.0070.07720.33
5.5.150.0130.03720.31
5.5.140.0070.03720.28
5.5.90.0070.03720.22
5.5.80.0000.04320.10
5.5.70.0030.04720.36
5.5.60.0030.03720.14
5.5.50.0000.04320.18
5.5.40.0030.06020.22
5.5.30.0000.05720.19
5.5.20.0030.04320.04
5.5.10.0100.04020.20
5.5.00.0100.03320.25
5.4.450.0100.08019.62
5.4.440.0100.05719.52
5.4.430.0070.08319.41
5.4.420.0130.06319.41
5.4.410.0130.06719.39
5.4.400.0100.04019.04
5.4.390.0170.07319.29
5.4.380.0030.07719.13
5.4.370.0030.05719.13
5.4.360.0030.08319.20
5.4.350.0070.04719.12
5.4.340.0100.07719.23
5.4.320.0000.04319.04
5.4.310.0100.04019.01
5.4.300.0030.04319.01
5.4.240.0030.03719.12
5.4.230.0070.03719.00
5.4.220.0030.04019.07
5.4.210.0030.05719.19
5.4.200.0030.03719.00
5.4.190.0030.04019.03
5.4.180.0100.03019.20
5.4.170.0070.03319.19
5.4.160.0070.04018.89
5.4.150.0070.03719.21
5.4.140.0000.04316.40
5.4.130.0130.05016.31
5.4.120.0030.03716.42
5.4.110.0070.03716.41
5.4.100.0030.03716.52
5.4.90.0070.03316.41
5.4.80.0000.03716.47
5.4.70.0030.08016.34
5.4.60.0100.06316.49
5.4.50.0200.06316.33
5.4.40.0030.07316.29
5.4.30.0130.06716.29
5.4.20.0130.03316.27
5.4.10.0130.03716.36
5.4.00.0100.06315.88
5.3.290.0070.09014.67
5.3.280.0000.04014.59
5.3.270.0000.04014.45
5.3.260.0070.03314.48
5.3.250.0000.04314.57
5.3.240.0030.03714.61
5.3.230.0030.03714.59
5.3.220.0130.03014.55
5.3.210.0070.05014.43
5.3.200.0000.04014.54
5.3.190.0100.03314.54
5.3.180.0070.03014.58
5.3.170.0070.05714.57
5.3.160.0070.07314.55
5.3.150.0070.06714.57
5.3.140.0000.07714.56
5.3.130.0170.07014.42
5.3.120.0130.07314.42
5.3.110.0070.06714.41
5.3.100.0030.04313.86
5.3.90.0030.04313.88
5.3.80.0130.06713.89
5.3.70.0100.05014.03
5.3.60.0070.07713.97
5.3.50.0200.05713.77
5.3.40.0130.07013.92
5.3.30.0100.07013.69
5.3.20.0000.04013.61
5.3.10.0000.07313.61
5.3.00.0100.06713.50
5.2.170.0030.03312.14
5.2.160.0030.06012.14
5.2.150.0100.03712.14
5.2.140.0030.05312.14
5.2.130.0100.06312.14
5.2.120.0070.05312.14
5.2.110.0070.05712.14
5.2.100.0030.05012.14
5.2.90.0030.06312.14
5.2.80.0030.05012.14
5.2.70.0100.05712.14
5.2.60.0030.06712.14
5.2.50.0130.06012.14
5.2.40.0070.05712.14
5.2.30.0100.04312.14
5.2.20.0100.03312.14
5.2.10.0070.05312.14
5.2.00.0130.06312.14
5.1.60.0000.04712.14
5.1.50.0100.04312.14
5.1.40.0000.06012.14
5.1.30.0070.02312.14
5.1.20.0030.04012.14
5.1.10.0030.05012.14
5.1.00.0100.05012.14
5.0.50.0030.04012.14
5.0.40.0000.02012.14
5.0.30.0000.06712.14
5.0.20.0030.01712.14
5.0.10.0070.01712.14
5.0.00.0000.04012.14
4.4.90.0070.03712.14
4.4.80.0030.03312.14
4.4.70.0000.03312.14
4.4.60.0000.03312.14
4.4.50.0030.03312.14
4.4.40.0030.03012.14
4.4.30.0000.02712.14
4.4.20.0070.02712.14
4.4.10.0100.02712.14
4.4.00.0000.02712.14
4.3.110.0030.03012.14
4.3.100.0000.03712.14
4.3.90.0030.03012.14
4.3.80.0030.02012.14
4.3.70.0000.03012.14
4.3.60.0030.01712.14
4.3.50.0070.03012.14
4.3.40.0000.05712.14
4.3.30.0000.02312.14
4.3.20.0070.03012.14
4.3.10.0000.01712.14
4.3.00.0000.03712.14

preferences:
39.23 ms | 400 KiB | 5 Q