3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($input, $key) { $size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $input = pkcs5_pad($input, $size); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); $data = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $input, MCRYPT_MODE_CBC, $iv); //$td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); //$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); //mcrypt_generic_init($td, $key, $iv); //$data = mcrypt_generic($td, $iv . $input); //mcrypt_generic_deinit($td); //mcrypt_module_close($td); $data = base64_encode($data); return $data; } function pkcs5_pad ($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); return $text . str_repeat(chr($pad), $pad); } function pkcs5_unpad($text) { $pad = ord($text{strlen($text)-1}); if ($pad > strlen($text)) return false; if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false; return substr($text, 0, -1 * $pad); } echo encrypt("1ocguknaus90psu76h0fnk7efsi9t2e1:tribus123", "1ocguknaus90psu76h0fnk7efsi9t2e1"); ?>

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.4.20.0130.00717.69
8.4.10.0100.01017.65
8.3.150.0040.00420.81
8.3.140.0090.00616.34
8.3.130.0080.00018.27
8.3.120.0000.00920.75
8.3.110.0070.00320.94
8.3.100.0030.00624.06
8.3.90.0140.00018.58
8.3.80.0030.00718.31
8.3.70.0120.00316.63
8.3.60.0040.01118.18
8.3.50.0130.00522.85
8.3.40.0150.00018.71
8.3.30.0070.00718.93
8.3.20.0050.00220.34
8.3.10.0080.00020.39
8.3.00.0060.00320.61
8.2.270.0140.00318.82
8.2.260.0050.00319.91
8.2.250.0080.00018.37
8.2.240.0030.00618.88
8.2.230.0030.00722.58
8.2.220.0030.00637.54
8.2.210.0000.00926.77
8.2.200.0030.00618.42
8.2.190.0090.00916.58
8.2.180.0130.00618.00
8.2.170.0140.00722.96
8.2.160.0120.00620.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0090.00626.16
8.2.120.0060.00319.36
8.2.110.0070.00320.35
8.2.100.0040.00717.78
8.2.90.0000.00818.92
8.2.80.0040.00417.97
8.2.70.0000.00817.38
8.2.60.0000.00817.88
8.2.50.0080.00018.10
8.2.40.0000.00819.88
8.2.30.0040.00419.57
8.2.20.0000.00817.46
8.2.10.0030.00517.96
8.2.00.0000.00817.45
8.1.310.0110.00716.40
8.1.300.0060.00320.01
8.1.290.0060.00318.88
8.1.280.0040.01125.92
8.1.270.0040.00422.24
8.1.260.0030.01226.35
8.1.250.0060.00328.09
8.1.240.0090.00020.81
8.1.230.0080.00320.90
8.1.220.0090.00017.74
8.1.210.0000.01118.77
8.1.200.0040.00417.22
8.1.190.0000.00917.13
8.1.180.0030.00618.10
8.1.170.0050.00318.51
8.1.160.0040.00418.80
8.1.150.0000.00718.79
8.1.140.0070.00217.41
8.1.130.0080.00017.71
8.1.120.0040.00417.35
8.1.110.0040.00417.36
8.1.100.0040.00417.41
8.1.90.0080.00017.41
8.1.80.0000.00817.34
8.1.70.0040.00417.18
8.1.60.0030.00717.33
8.1.50.0040.00417.32
8.1.40.0040.00417.43
8.1.30.0040.00417.59
8.1.20.0040.00417.55
8.1.10.0080.00017.41
8.1.00.0040.00417.18
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.38
8.0.270.0070.00017.15
8.0.260.0060.00017.03
8.0.250.0030.00316.84
8.0.240.0000.00816.83
8.0.230.0040.00416.87
8.0.220.0000.00716.79
8.0.210.0080.00016.81
8.0.200.0030.00316.91
8.0.190.0040.00716.78
8.0.180.0040.00416.83
8.0.170.0040.00416.80
8.0.160.0070.00016.83
8.0.150.0000.00816.66
8.0.140.0020.00516.79
8.0.130.0000.00713.37
8.0.120.0040.00416.91
8.0.110.0040.00416.76
8.0.100.0030.00316.75
8.0.90.0040.00416.68
8.0.80.0100.00716.83
8.0.70.0040.00416.97
8.0.60.0040.00416.90
8.0.50.0000.00816.74
8.0.30.0090.01117.10
8.0.20.0100.01217.40
8.0.10.0000.00717.04
8.0.00.0120.00916.56
7.4.330.0030.00315.02
7.4.320.0000.00616.31
7.4.300.0060.00016.54
7.4.290.0000.00816.59
7.4.280.0070.00016.54
7.4.270.0000.00716.47
7.4.260.0070.00316.54
7.4.250.0000.00716.41
7.4.240.0040.00316.53
7.4.230.0030.00316.63
7.4.220.0120.00816.58
7.4.210.0090.01216.38
7.4.200.0070.00016.55
7.4.160.0080.00816.37
7.4.150.0060.01317.40
7.4.140.0130.00417.86
7.4.130.0110.00616.54
7.4.120.0080.01216.49
7.4.110.0110.00616.42
7.4.100.0110.00616.47
7.4.90.0110.00716.32
7.4.80.0160.00619.39
7.4.70.0210.00016.55
7.4.60.0070.01016.41
7.4.50.0030.00316.24
7.4.40.0100.00616.45
7.4.30.0110.01116.43
7.4.00.0150.00015.07
7.3.330.0000.00513.33
7.3.320.0000.00613.21
7.3.310.0040.00416.36
7.3.300.0000.00716.22
7.3.290.0070.00816.29
7.3.280.0080.01016.34
7.3.270.0120.01317.40
7.3.260.0110.00816.29
7.3.250.0120.00516.51
7.3.240.0130.00516.48
7.3.230.0060.00916.56
7.3.210.0070.01016.24
7.3.200.0060.01319.39
7.3.190.0140.00916.41
7.3.180.0000.01616.41
7.3.170.0120.00916.44
7.3.160.0070.01116.46
7.3.10.0150.00316.41
7.3.00.0200.00616.37
7.2.330.0150.00916.63
7.2.320.0060.01616.62
7.2.310.0060.01016.64
7.2.300.0060.01116.44
7.2.290.0080.00816.57
7.2.130.0130.00316.59
7.2.120.0160.00816.31
7.2.110.0160.01016.64
7.2.100.0140.01416.57
7.2.90.0160.00716.67
7.2.80.0250.00616.36
7.2.70.0130.01116.63
7.2.60.0090.01116.70
7.2.50.0200.00716.72
7.2.40.0200.00816.46
7.2.30.0120.00616.76
7.2.20.0140.00916.94
7.2.10.0100.01316.50
7.2.00.0060.01117.96
7.1.250.0140.00515.41
7.1.200.0060.00615.76
7.1.100.0000.01118.01
7.1.70.0040.00417.04
7.1.60.0100.01419.34
7.1.50.0040.01816.81
7.1.00.0030.07722.33
7.0.200.0040.00416.60
7.0.140.0070.03322.00
7.0.60.0100.05319.85
7.0.50.0070.04017.95
7.0.40.0070.05020.11
7.0.30.0230.03720.09
7.0.20.0330.05020.27
7.0.10.0170.07320.34
7.0.00.0130.08320.23
5.6.280.0000.07720.91
5.6.210.0100.07020.73
5.6.200.0170.07718.25
5.6.190.0030.05720.58
5.6.180.3300.04320.46
5.6.170.0230.04020.50
5.6.160.0030.04320.54
5.6.150.0000.05718.27
5.6.140.0100.06318.23
5.6.130.0100.04718.15
5.6.120.0070.04020.93
5.6.110.0070.06720.99
5.6.100.0030.05721.04
5.6.90.0100.08021.03
5.6.80.0100.08720.32
5.6.70.3300.03720.42
5.5.350.0000.08320.45
5.5.340.0030.04018.00
5.5.330.0070.04720.59
5.5.320.0300.08320.32
5.5.310.0200.04320.27
5.5.300.0030.07018.15
5.5.290.0100.07718.02
5.5.280.0000.05021.03
5.5.270.0070.05721.02
5.5.260.0100.07720.94
5.5.250.0070.03720.70
5.5.240.0330.04020.34
5.4.450.0270.05034.67
5.4.440.0600.04329.29
5.4.430.0230.04727.78
5.4.420.0370.04727.77
5.4.410.0000.03327.58
5.4.400.0370.04027.27
5.4.390.0270.04026.72
5.4.380.0270.03726.47
5.4.370.0200.04025.95
5.4.360.0100.04725.79
5.4.350.0080.03512.03
5.4.340.0040.03812.02
5.4.320.0070.04112.51
5.4.310.0080.04012.51
5.4.300.0060.04712.51
5.4.290.0090.04512.51
5.4.280.0070.03512.41
5.4.270.0050.04012.41
5.4.260.0050.04612.41
5.4.250.0050.03912.41
5.4.240.0070.03612.41
5.4.230.0070.03712.39
5.4.220.0070.03512.39
5.4.210.0070.03512.39
5.4.200.0060.03812.39
5.4.190.0100.04212.40
5.4.180.0040.04312.39
5.4.170.0040.04312.40
5.4.160.0060.03712.40
5.4.150.0070.03912.39
5.4.140.0080.03512.08
5.4.130.0080.04412.07
5.4.120.0090.03512.03
5.4.110.0030.04312.02
5.4.100.0070.03912.02
5.4.90.0070.04212.02
5.4.80.0050.03812.02
5.4.70.0070.04112.02
5.4.60.0090.03812.02
5.4.50.0080.04112.01
5.4.40.0050.03512.00
5.4.30.0090.03512.00
5.4.20.0090.03212.00
5.4.10.0050.03912.00
5.4.00.0030.04111.49
5.3.290.0050.04312.80
5.3.280.0060.04012.71
5.3.270.0060.04312.72
5.3.260.0090.03912.72
5.3.250.0100.04512.71
5.3.240.0090.03412.72
5.3.230.0110.03312.71
5.3.220.0050.04012.68
5.3.210.0050.04012.68
5.3.200.0090.03612.68
5.3.190.0080.04012.68
5.3.180.0100.04412.67
5.3.170.0070.03812.66
5.3.160.0060.03812.67
5.3.150.0070.03612.68
5.3.140.0070.03512.66
5.3.130.0070.04112.66
5.3.120.0080.03912.66
5.3.110.0060.03812.65
5.3.100.0030.03912.13
5.3.90.0050.03612.11
5.3.80.0080.03412.11
5.3.70.0090.03212.11
5.3.60.0020.03912.09
5.3.50.0040.03712.04
5.3.40.0040.03812.04
5.3.30.0050.03711.99
5.3.20.0070.04211.77
5.3.10.0030.03811.74
5.3.00.0050.03711.73
5.2.170.0080.0309.24
5.2.160.0060.0279.23
5.2.150.0070.0369.24
5.2.140.0050.0359.23
5.2.130.0080.0299.19
5.2.120.0070.0329.19
5.2.110.0060.0299.19
5.2.100.0050.0299.19
5.2.90.0050.0299.19
5.2.80.0060.0309.18
5.2.70.0050.0319.18
5.2.60.0070.0289.14
5.2.50.0060.0309.12
5.2.40.0050.0309.09
5.2.30.0010.0339.05
5.2.20.0030.0299.05
5.2.10.0040.0288.95
5.2.00.0070.0378.82
5.1.60.0040.0298.10
5.1.50.0040.0318.10
5.1.40.0060.0268.08
5.1.30.0050.0278.43
5.1.20.0050.0288.45
5.1.10.0030.0298.18
5.1.00.0030.0278.18
5.0.50.0010.0256.65
5.0.40.0030.0216.52
5.0.30.0040.0326.32
5.0.20.0040.0206.30
5.0.10.0010.0246.28
5.0.00.0050.0306.27
4.4.90.0040.0144.78
4.4.80.0020.0184.75
4.4.70.0020.0194.75
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0040.0264.71
4.4.30.0030.0154.76
4.4.20.0040.0184.84
4.4.10.0050.0224.85
4.4.00.0010.0294.76
4.3.110.0030.0184.67
4.3.100.0040.0154.67
4.3.90.0010.0164.63
4.3.80.0050.0284.58
4.3.70.0020.0154.63
4.3.60.0060.0114.63
4.3.50.0010.0164.63
4.3.40.0030.0274.53
4.3.30.0000.0183.31
4.3.20.0030.0163.29
4.3.10.0030.0213.25
4.3.00.0070.01324.91

preferences:
34.89 ms | 403 KiB | 5 Q