3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($texttocrypt, $ky, $iv) { // $ky = '5rrdv4lkjdshfkl43bgd'; // Key from file // $iv = ; try { $encrypted = ""; $length = strlen($texttocrypt); $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, ''); mcrypt_generic_init($cipher, $ky, $iv); $encrypted = base64_encode(mcrypt_generic($cipher, $texttocrypt)); mcrypt_generic_deinit($cipher); $result1 = bin2hex($iv); $result2 = bin2hex($encrypted); $result = $result1 . $result2; return $result; } catch (Exception $e) { $this->lastError = "Error while encrypting '".$texttocrypt."' - ".$e->getMessage(); throw new Exception($this->lastError); } } echo encrypt('sup#own#hnf#15', 'jhfjdjj%6s77w', '234ghyjdGt57Bgsde764Lo905hvfDw20');

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.0030.02018.20
8.3.50.0160.00316.37
8.3.40.0030.01318.85
8.3.30.0140.00418.88
8.3.20.0040.00420.29
8.3.10.0040.00423.66
8.3.00.0040.00423.67
8.2.180.0090.01218.05
8.2.170.0040.01122.96
8.2.160.0070.00722.04
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0060.00317.63
8.2.110.0090.00019.41
8.2.100.0110.00017.63
8.2.90.0040.00419.20
8.2.80.0080.00017.97
8.2.70.0030.00517.63
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0040.00421.18
8.2.30.0060.00319.66
8.2.20.0040.00417.67
8.2.10.0000.00717.94
8.2.00.0000.00817.97
8.1.280.0040.01125.92
8.1.270.0080.00020.43
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0000.01021.16
8.1.230.0120.00017.55
8.1.220.0030.00617.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0040.00422.00
8.1.150.0000.00718.88
8.1.140.0000.00817.43
8.1.130.0030.00317.64
8.1.120.0000.00717.43
8.1.110.0000.00817.30
8.1.100.0040.00417.36
8.1.90.0070.00317.36
8.1.80.0050.00317.40
8.1.70.0000.00717.38
8.1.60.0030.00517.50
8.1.50.0000.00717.52
8.1.40.0030.00517.40
8.1.30.0040.00417.62
8.1.20.0040.00417.55
8.1.10.0040.00417.64
8.1.00.0050.00217.53
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0000.00718.40
8.0.270.0040.00417.12
8.0.260.0000.00817.07
8.0.250.0000.00816.98
8.0.240.0040.00416.85
8.0.230.0060.00316.86
8.0.220.0030.00316.81
8.0.210.0040.00416.93
8.0.200.0000.00616.97
8.0.190.0030.00616.98
8.0.180.0040.00416.89
8.0.170.0060.00316.99
8.0.160.0020.00516.91
8.0.150.0000.00716.81
8.0.140.0070.00016.87
8.0.130.0030.00613.36
8.0.120.0040.00416.87
8.0.110.0040.00416.88
8.0.100.0040.00416.73
8.0.90.0070.00016.78
8.0.80.0130.00716.86
8.0.70.0040.00416.77
8.0.60.0030.00516.79
8.0.50.0080.00017.00
8.0.30.0130.00516.72
8.0.20.0100.00917.40
8.0.10.0070.00017.06
8.0.00.0060.01216.72
7.4.330.0000.00515.22
7.4.320.0000.00616.52
7.4.300.0000.00616.52
7.4.290.0030.00316.43
7.4.280.0000.00816.61
7.4.270.0000.00716.52
7.4.260.0030.00316.56
7.4.250.0000.00816.57
7.4.240.0050.00216.51
7.4.230.0070.00016.60
7.4.220.0140.00416.63
7.4.210.0120.00916.61
7.4.200.0000.00716.36
7.4.160.0080.00816.35
7.4.150.0060.01217.40
7.4.140.0120.01217.86
7.4.130.0090.00816.52
7.4.120.0090.01316.51
7.4.110.0130.00316.51
7.4.100.0120.01216.51
7.4.90.0090.00916.54
7.4.80.0090.00919.39
7.4.70.0100.00716.58
7.4.60.0060.00916.74
7.4.50.0040.00416.42
7.4.40.0120.00416.55
7.4.30.0030.01616.52
7.4.00.0070.01014.81
7.3.330.0000.00513.34
7.3.320.0030.00313.40
7.3.310.0000.00716.41
7.3.300.0040.00416.23
7.3.290.0070.00916.31
7.3.280.0070.00916.32
7.3.270.0130.00317.40
7.3.260.0100.00716.49
7.3.250.0130.00416.44
7.3.240.0090.00916.40
7.3.230.0150.00716.48
7.3.210.0100.00716.66
7.3.200.0150.00316.54
7.3.190.0110.00516.48
7.3.180.0180.00316.55
7.3.170.0070.01316.45
7.3.160.0060.01116.48
7.2.330.0110.00716.50
7.2.320.0030.01416.43
7.2.310.0000.01516.66
7.2.300.0170.00816.44
7.2.290.0100.01316.66
7.2.60.0100.00316.78
7.2.00.0070.00719.45
7.1.200.0090.00015.68
7.1.100.0000.01117.86
7.1.70.0080.00316.77
7.1.60.0130.01019.42
7.1.50.0030.02016.58
7.1.00.0030.07722.35
7.0.200.0190.00416.37
7.0.60.0100.07019.93
7.0.50.0030.05017.98
7.0.40.0170.08020.26
7.0.30.0230.05720.15
7.0.20.0300.06020.16
7.0.10.0100.04320.17
7.0.00.0100.08020.30
5.6.280.0070.06720.87
5.6.210.0100.06720.48
5.6.200.0000.05318.20
5.6.190.0100.08020.66
5.6.180.0530.07020.44
5.6.170.0370.06320.63
5.6.160.0230.06020.52
5.6.150.0030.03718.25
5.6.140.0000.05318.34
5.6.130.0130.07318.19
5.6.120.0100.03321.14
5.6.110.0100.06721.08
5.6.100.0070.06021.18
5.6.90.0130.03021.10
5.6.80.0130.05320.49
5.5.350.3970.04020.41
5.5.340.0270.07317.99
5.5.330.0070.05720.46
5.5.320.0270.03720.31
5.5.310.0370.07720.36
5.5.300.0070.07718.09
5.5.290.0100.07018.00
5.5.280.0130.07020.82
5.5.270.0100.07720.83
5.5.260.0030.08020.90
5.5.250.0000.05720.58
5.5.240.0030.08320.31
5.4.450.0800.05319.52
5.4.440.0200.05719.66
5.4.430.0170.06319.76
5.4.420.0200.05719.52
5.4.410.0270.07019.63
5.4.400.0130.06019.05
5.4.390.0100.06319.35
5.4.380.0270.07319.05
5.4.370.0200.07718.89
5.4.360.0200.05319.16
5.4.350.0130.06719.19
5.4.340.0170.05719.34
5.4.320.0270.04719.31
5.4.310.0230.05019.20
5.4.300.0070.06719.05
5.4.290.0200.05018.87
5.4.280.0300.04319.20
5.4.270.0270.05719.34
5.4.260.0230.05019.05
5.4.250.0200.06319.05
5.4.240.0300.05319.15
5.4.230.0170.06319.18
5.4.220.0230.06019.19
5.4.210.0170.06019.12
5.4.200.0130.05716.81
5.4.190.0270.06019.11
5.4.180.0370.04319.01
5.4.170.0270.05019.16
5.4.160.0230.04319.13
5.4.150.0230.04719.36
5.4.140.0200.05316.59
5.4.130.0170.05716.47
5.4.120.0230.04716.52
5.4.110.0230.04316.63
5.4.100.0100.05716.58
5.4.90.0170.07316.59
5.4.80.0270.05316.57
5.4.70.0130.05716.59
5.4.60.0230.04316.39
5.4.50.0230.04316.59
5.4.40.0170.05016.36
5.4.30.0170.07016.44
5.4.20.0170.05316.53
5.4.10.0100.05716.52
5.4.00.0170.06016.04
5.3.290.0100.05714.71
5.3.280.0230.04714.58
5.3.270.0270.06714.52
5.3.260.0330.06314.46
5.3.250.0100.05714.52
5.3.240.0300.04314.50
5.3.230.0270.04314.68
5.3.220.0230.04314.65
5.3.210.0230.07014.61
5.3.200.0200.04714.48
5.3.190.0170.05014.57
5.3.180.0270.04714.78
5.3.170.0270.04714.58
5.3.160.0130.05714.58
5.3.150.0200.04714.63
5.3.140.0200.04714.51
5.3.130.0200.06314.43
5.3.120.0170.05314.63
5.3.110.0300.04714.51
5.3.100.0130.05314.05
5.3.90.0200.05013.94
5.3.80.0230.04014.07
5.3.70.0230.04314.07
5.3.60.0200.05013.86
5.3.50.0270.05713.85
5.3.40.0130.05714.09
5.3.30.0200.06013.91
5.3.20.0130.06313.60
5.3.10.0230.04313.80
5.3.00.0200.04713.81
5.2.170.0230.03311.23
5.2.160.0100.04311.17
5.2.150.0130.04011.01
5.2.140.0130.04011.20
5.2.130.0200.03711.06
5.2.120.0130.03711.11
5.2.110.0270.03311.00
5.2.100.0130.04011.25
5.2.90.0130.04011.02
5.2.80.0100.04711.00
5.2.70.0100.04311.10
5.2.60.0030.05010.96
5.2.50.0100.04310.93
5.2.40.0070.04711.00
5.2.30.0100.04011.11
5.2.20.0230.03010.87
5.2.10.0170.03311.08
5.2.00.0100.04010.66
5.1.60.0170.02710.05
5.1.50.0170.0309.88
5.1.40.0070.0379.91
5.1.30.0130.03710.17
5.1.20.0130.05010.57
5.1.10.0170.04010.00
5.1.00.0130.0339.95
5.0.50.0100.0278.56
5.0.40.0070.0278.50
5.0.30.0070.0438.16
5.0.20.0100.0308.15
5.0.10.0070.0338.21
5.0.00.0070.0408.07
4.4.90.0100.0175.81
4.4.80.0070.0205.75
4.4.70.0070.0205.82
4.4.60.0030.0235.84
4.4.50.0070.0205.85
4.4.40.0070.0475.87
4.4.30.0030.0235.77
4.4.20.0070.0205.94
4.4.10.0000.0275.89
4.4.00.0070.0475.82
4.3.110.0070.0305.70
4.3.100.0070.0275.69
4.3.90.0130.0135.78
4.3.80.0030.0375.75
4.3.70.0130.0135.75
4.3.60.0000.0335.65
4.3.50.0100.0275.66
4.3.40.0070.0335.70
4.3.30.0000.0274.50
4.3.20.0000.0274.50
4.3.10.0000.0274.45
4.3.00.0170.0208.43

preferences:
51.51 ms | 400 KiB | 5 Q