3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(extension_loaded('mcrypt')); var_dump(extension_loaded('openssl')); $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.40.0120.00918.84
8.3.30.0030.01020.21
8.3.20.0050.00220.34
8.3.10.0060.00322.09
8.3.00.0080.00022.46
8.2.170.0110.00322.96
8.2.160.0040.01122.12
8.2.150.0040.01424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.36
8.2.110.0030.00722.20
8.2.100.0040.00817.72
8.2.90.0000.00819.22
8.2.80.0040.00419.24
8.2.70.0080.00017.63
8.2.60.0000.00818.04
8.2.50.0000.00918.07
8.2.40.0090.00318.09
8.2.30.0060.00317.98
8.2.20.0070.00017.66
8.2.10.0050.00217.77
8.2.00.0040.00417.75
8.1.270.0040.00424.66
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0030.00623.96
8.1.230.0040.00818.89
8.1.220.0090.00017.76
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.43
8.1.180.0000.00919.01
8.1.170.0050.00318.57
8.1.160.0030.00520.78
8.1.150.0080.00018.59
8.1.140.0000.00717.32
8.1.130.0000.00817.81
8.1.120.0040.00417.42
8.1.110.0050.00317.33
8.1.100.0030.00517.32
8.1.90.0030.00717.32
8.1.80.0000.00717.34
8.1.70.0020.00517.33
8.1.60.0040.00417.48
8.1.50.0060.00317.45
8.1.40.0000.00817.55
8.1.30.0000.00717.68
8.1.20.0030.00617.64
8.1.10.0000.00717.61
8.1.00.0040.00417.50
8.0.300.0000.00718.77
8.0.290.0040.00416.93
8.0.280.0030.00318.39
8.0.270.0000.00717.17
8.0.260.0000.00616.84
8.0.250.0070.00016.86
8.0.240.0050.00217.03
8.0.230.0070.00016.96
8.0.220.0000.00716.91
8.0.210.0080.00016.88
8.0.200.0070.00016.86
8.0.190.0080.00017.04
8.0.180.0050.00316.98
8.0.170.0000.00816.90
8.0.160.0030.00316.94
8.0.150.0050.00316.88
8.0.140.0000.00816.77
8.0.130.0030.00313.27
8.0.120.0040.00416.82
8.0.110.0000.00716.97
8.0.100.0030.00516.95
8.0.90.0040.00416.98
8.0.80.0110.00416.86
8.0.70.0040.00416.78
8.0.60.0060.00316.95
8.0.50.0060.00316.76
8.0.30.0060.01317.08
8.0.20.0080.01017.40
8.0.10.0050.00216.81
8.0.00.0090.01116.80
7.4.330.0000.00515.00
7.4.320.0000.00616.32
7.4.300.0000.00616.54
7.4.290.0080.00016.67
7.4.280.0000.00716.57
7.4.270.0070.00016.54
7.4.260.0060.00313.28
7.4.250.0040.00416.44
7.4.240.0040.00416.53
7.4.230.0030.00316.55
7.4.220.0200.00316.74
7.4.210.0070.00816.58
7.4.200.0000.00716.52
7.4.190.0020.00516.71
7.4.160.0120.00316.44
7.4.150.0060.01017.40
7.4.140.0090.00817.86
7.4.130.0110.00516.53
7.4.120.0060.01016.51
7.4.110.0130.00316.48
7.4.100.0140.00316.37
7.4.90.0060.01216.65
7.4.80.0030.01319.39
7.4.70.0060.01016.50
7.4.60.0130.00316.63
7.4.50.0030.00616.69
7.4.40.0100.00622.77
7.4.30.0060.01916.53
7.4.10.0030.01614.93
7.4.00.0040.01415.02
7.3.330.0030.00313.02
7.3.320.0020.00312.96
7.3.310.0000.00716.25
7.3.300.0030.00316.27
7.3.290.0030.01016.32
7.3.280.0130.00616.32
7.3.270.0030.01317.40
7.3.260.0190.00316.43
7.3.250.0090.00816.32
7.3.240.0130.00416.33
7.3.230.0130.00316.46
7.3.210.0070.01016.47
7.3.200.0140.00319.39
7.3.190.0140.00616.20
7.3.180.0120.00316.40
7.3.170.0130.01016.30
7.3.160.0070.01416.20
7.3.130.0060.01314.97
7.3.120.0030.01314.84
7.3.110.0060.01014.75
7.3.100.0090.00614.77
7.3.90.0060.01015.01
7.3.80.0060.00614.87
7.3.70.0110.00414.64
7.3.60.0030.01014.80
7.3.50.0000.01514.77
7.3.40.0040.00714.91
7.3.30.0100.00714.89
7.3.20.0050.00516.53
7.3.10.0040.00716.59
7.3.00.0070.00716.64
7.2.330.0100.00716.60
7.2.320.0130.00316.57
7.2.310.0110.00616.43
7.2.300.0060.01016.18
7.2.290.0060.01416.63
7.2.260.0060.01214.84
7.2.250.0040.01615.00
7.2.240.0040.01415.02
7.2.230.0070.00714.93
7.2.220.0080.01214.84
7.2.210.0000.01514.98
7.2.200.0070.00714.68
7.2.190.0030.00714.97
7.2.180.0110.00415.10
7.2.170.0030.01214.99
7.2.160.0030.00914.91
7.2.150.0060.00616.53
7.2.140.0100.00616.79
7.2.130.0060.00916.83
7.2.120.0120.00416.77
7.2.110.0030.01016.86
7.2.100.0100.00616.82
7.2.90.0040.01516.47
7.2.80.0090.00616.58
7.2.70.0070.01016.80
7.2.60.0080.01016.69
7.2.50.0060.01216.57
7.2.40.0090.00016.74
7.2.30.0060.00916.75
7.2.20.0100.00316.81
7.2.10.0000.01416.55
7.2.00.0060.00818.10
7.1.330.0060.01015.85
7.1.320.0120.00615.70
7.1.310.0060.00815.80
7.1.300.0080.00815.52
7.1.290.0070.00315.68
7.1.280.0070.00415.48
7.1.270.0000.00915.83
7.1.260.0000.01315.76
7.1.250.0060.00915.49
7.1.240.0030.01015.52
7.1.230.0060.00915.52
7.1.220.0120.00315.47
7.1.210.0100.00315.48
7.1.200.0080.00715.59
7.1.190.0070.01115.71
7.1.180.0120.00415.57
7.1.170.0000.01315.84
7.1.160.0100.00615.68
7.1.150.0070.00715.78
7.1.140.0000.01415.63
7.1.130.0030.01315.69
7.1.120.0060.00915.73
7.1.110.0030.01315.77
7.1.100.0040.00616.64
7.1.90.0060.00615.76
7.1.80.0030.01315.70
7.1.70.0000.01016.40
7.1.60.0100.00917.56
7.1.50.0090.01016.10
7.1.40.0000.01115.46
7.1.30.0070.00715.48
7.1.20.0100.00315.63
7.1.10.0000.01015.75
7.1.00.0020.02219.07
7.0.330.0040.00815.23
7.0.320.0090.00315.12
7.0.310.0040.00815.48
7.0.300.0090.00615.32
7.0.290.0040.00815.29
7.0.280.0000.00915.33
7.0.270.0140.00015.31
7.0.260.0090.00615.36
7.0.250.0030.01015.17
7.0.240.0040.00415.16
7.0.230.0070.00715.33
7.0.220.0000.01615.32
7.0.210.0080.00815.45
7.0.200.0150.00714.85
7.0.190.0040.00715.36
7.0.180.0030.00715.39
7.0.170.0040.00815.34
7.0.160.0060.00315.16
7.0.150.0030.01015.06
7.0.140.0040.04018.54
7.0.130.0120.00015.33
7.0.120.0060.01015.26
7.0.110.0040.00915.25
7.0.100.0200.03717.54
7.0.90.0250.03817.68
7.0.80.0220.04217.55
7.0.70.0250.03517.57
7.0.60.0220.03917.58
7.0.50.0190.02717.85
7.0.40.0030.04816.84
7.0.30.0090.03716.75
7.0.20.0100.04216.71
7.0.10.0100.04216.78
7.0.00.0070.04916.83
5.6.400.0070.00713.77
5.6.390.0070.00414.61
5.6.380.0060.00314.18
5.6.370.0100.00314.56
5.6.360.0070.00714.00
5.6.350.0000.01414.05
5.6.340.0060.01014.28
5.6.330.0040.01114.11
5.6.320.0120.00014.32
5.6.310.0030.01014.18
5.6.300.0070.00714.16
5.6.290.0070.00313.93
5.6.280.0040.04317.64
5.6.270.0080.00814.18
5.6.260.0030.01013.95
5.6.250.0050.04317.53
5.6.240.0050.04117.38
5.6.230.0030.04517.58
5.6.220.0080.02817.22
5.6.210.0080.04517.38
5.6.200.0020.04017.63
5.6.190.0050.04217.73
5.6.180.0050.03017.72
5.6.170.0070.04317.50
5.6.160.0020.05117.76
5.6.150.0100.04217.81
5.6.140.0090.04117.53
5.6.130.0050.04817.64
5.6.120.0120.04217.62
5.6.110.0110.04317.63
5.6.100.0080.03017.73
5.6.90.0070.04517.75
5.6.80.0040.04617.43
5.6.70.0090.04417.36
5.6.60.0130.03717.21
5.6.50.0060.04117.32
5.6.40.0070.04417.30
5.6.30.0030.04517.13
5.6.20.0060.04317.23
5.6.10.0030.04517.20
5.6.00.0050.04517.34
5.5.380.0060.03317.03
5.5.370.0030.04917.37
5.5.360.0160.03717.27
5.5.350.0070.04217.29
5.5.340.0040.04617.68
5.5.330.0080.02717.36
5.5.320.0070.02517.47
5.5.310.0090.04617.63
5.5.300.0060.05017.52
5.5.290.0100.02617.47
5.5.280.0100.03917.44
5.5.270.0080.04317.60
5.5.260.0090.04217.36
5.5.250.0080.04117.33
5.5.240.0080.04117.19
5.5.230.0070.03917.21
5.5.220.0090.04017.12
5.5.210.0030.02817.22
5.5.200.0030.04716.99
5.5.190.0080.04217.09
5.5.180.0040.02917.21
5.5.170.0040.00413.89
5.5.160.0030.04317.15
5.5.150.0090.02717.12
5.5.140.0120.03717.07
5.5.130.0050.03117.08
5.5.120.0020.02717.16
5.5.110.0020.02717.07
5.5.100.0050.02216.94
5.5.90.0050.02616.98
5.5.80.0020.02717.09
5.5.70.0050.02217.11
5.5.60.0020.02517.18
5.5.50.0100.01616.96
5.5.40.0040.02417.01
5.5.30.0080.03217.13
5.5.20.0050.03017.03
5.5.10.0050.03817.08
5.5.00.0050.04317.23
5.4.450.0120.03715.64
5.4.440.0090.04215.66
5.4.430.0040.04215.63
5.4.420.0050.04115.56
5.4.410.0050.02515.41
5.4.400.0070.04315.31
5.4.390.0030.04415.31
5.4.380.0130.03415.42
5.4.370.0030.04415.31
5.4.360.0050.04215.45
5.4.350.0030.04015.38
5.4.340.0060.04115.41
5.4.330.0060.00311.71
5.4.320.0050.04015.41
5.4.310.0050.03215.47
5.4.300.0020.02515.41
5.4.290.0080.01715.36
5.4.280.0000.04315.46
5.4.270.0030.02815.40
5.4.260.0020.04115.36
5.4.250.0030.03315.50
5.4.240.0080.01815.36
5.4.230.0020.02315.47
5.4.220.0030.02315.45
5.4.210.0060.02615.49
5.4.200.0050.02215.41
5.4.190.0030.02215.40
5.4.180.0050.02015.35
5.4.170.0060.01915.40
5.4.160.0080.01815.47
5.4.150.0030.02815.46
5.4.140.0030.02314.02
5.4.130.0070.02013.92
5.4.120.0030.02013.99
5.4.110.0050.02514.00
5.4.100.0030.02014.01
5.4.90.0020.02314.05
5.4.80.0020.02214.06
5.4.70.0030.02714.05
5.4.60.0050.02214.04
5.4.50.0000.03114.02
5.4.40.0030.02314.05
5.4.30.0050.02014.00
5.4.20.0000.03014.10
5.4.10.0060.01814.05
5.4.00.0000.02613.73
5.3.290.0020.04413.12
5.3.280.0030.02213.07
5.3.270.0070.03113.15
5.3.260.0050.02013.09
5.3.250.0070.01713.15
5.3.240.0060.03413.07
5.3.230.0050.02113.07
5.3.220.0020.02313.10
5.3.210.0070.02213.08
5.3.200.0000.03013.13
5.3.190.0050.01813.07
5.3.180.0020.02513.07
5.3.170.0020.02513.12
5.3.160.0030.02313.10
5.3.150.0030.02013.14
5.3.140.0020.02313.14
5.3.130.0030.03113.11
5.3.120.0030.02213.13
5.3.110.0030.02113.04
5.3.100.0060.01712.81
5.3.90.0050.03312.82
5.3.80.0000.02512.86
5.3.70.0040.01812.82
5.3.60.0000.04112.85
5.3.50.0030.02212.82
5.3.40.0020.02412.81
5.3.30.0050.02012.79
5.3.20.0030.02512.58
5.3.10.0050.03712.64
5.3.00.0080.03412.68
5.2.170.0030.02712.20
5.2.160.0000.03012.20
5.2.150.0000.03012.20
5.2.140.0030.02712.20
5.2.130.0000.04012.20
5.2.120.0000.03012.20
5.2.110.0070.02712.20
5.2.100.0000.03012.20
5.2.90.0070.02312.20
5.2.80.0100.05012.20
5.2.70.0030.06712.20
5.2.60.0030.04312.20
5.2.50.0030.05712.20
5.2.40.0030.06312.20
5.2.30.0070.06312.20
5.2.20.0100.05312.20
5.2.10.0100.05312.20
5.2.00.0030.06012.20
5.1.60.0030.05312.20
5.1.50.0030.05312.20
5.1.40.0000.05712.20
5.1.30.0070.05712.20
5.1.20.0030.05012.20
5.1.10.0100.05012.20
5.1.00.0030.05712.20
5.0.50.0070.04312.20
5.0.40.0130.03312.20
5.0.30.0070.05712.20
5.0.20.0030.04312.20
5.0.10.0030.03712.20
5.0.00.0030.06312.20
4.4.90.0000.03712.20
4.4.80.0000.03712.20
4.4.70.0030.03312.20
4.4.60.0030.03312.20
4.4.50.0000.02712.20
4.4.40.0000.04312.20
4.4.30.0000.03312.20
4.4.20.0000.03712.20
4.4.10.0000.03712.20
4.4.00.0100.04712.20
4.3.110.0070.02312.20
4.3.100.0000.03712.20
4.3.90.0000.03712.20
4.3.80.0070.03712.20
4.3.70.0070.02012.20
4.3.60.0030.03312.20
4.3.50.0070.03012.20
4.3.40.0070.05012.20
4.3.30.0030.03012.20
4.3.20.0070.03312.20
4.3.10.0000.03712.20
4.3.00.0000.03712.20

preferences:
42.33 ms | 400 KiB | 5 Q