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', '234ghyjdGtskjdhfkjhvfDw20');

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.00918.67
8.3.50.0140.00621.27
8.3.40.0120.00918.66
8.3.30.0160.00318.67
8.3.20.0040.00420.26
8.3.10.0080.00023.65
8.3.00.0000.00723.51
8.2.180.0040.01516.50
8.2.170.0180.00322.96
8.2.160.0070.00722.17
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0090.00017.63
8.2.110.0030.00719.21
8.2.100.0120.00417.76
8.2.90.0030.00517.75
8.2.80.0060.00317.97
8.2.70.0030.00517.80
8.2.60.0040.00417.90
8.2.50.0090.00018.10
8.2.40.0040.00419.16
8.2.30.0040.00419.13
8.2.20.0040.00417.72
8.2.10.0050.00218.02
8.2.00.0000.00818.02
8.1.280.0120.00325.92
8.1.270.0000.01020.38
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0070.00720.30
8.1.230.0110.00022.20
8.1.220.0060.00317.74
8.1.210.0030.00718.77
8.1.200.0060.00317.22
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0000.00818.44
8.1.160.0040.00418.75
8.1.150.0020.00518.88
8.1.140.0040.00417.44
8.1.130.0030.00317.63
8.1.120.0070.00017.29
8.1.110.0060.00317.38
8.1.100.0000.00817.31
8.1.90.0110.00017.33
8.1.80.0060.00317.37
8.1.70.0030.00317.28
8.1.60.0040.00417.62
8.1.50.0000.00817.50
8.1.40.0030.00617.48
8.1.30.0040.00417.38
8.1.20.0000.00717.67
8.1.10.0040.00417.62
8.1.00.0000.00717.53
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.37
8.0.270.0000.00717.25
8.0.260.0060.00017.21
8.0.250.0000.00816.95
8.0.240.0030.00316.94
8.0.230.0030.00617.02
8.0.220.0030.00316.78
8.0.210.0000.00816.96
8.0.200.0000.00716.96
8.0.190.0050.00317.00
8.0.180.0040.00416.93
8.0.170.0040.00416.94
8.0.160.0030.00316.80
8.0.150.0070.00016.75
8.0.140.0000.00716.73
8.0.130.0000.00613.36
8.0.120.0000.00716.75
8.0.110.0040.00416.79
8.0.100.0040.00416.85
8.0.90.0000.00816.96
8.0.80.0130.00716.93
8.0.70.0070.00016.74
8.0.60.0040.00416.76
8.0.50.0040.00416.93
8.0.30.0040.01417.06
8.0.20.0100.00917.40
8.0.10.0040.00417.04
8.0.00.0100.00716.63
7.4.330.0000.00515.08
7.4.320.0030.00316.44
7.4.300.0030.00316.51
7.4.290.0080.00016.55
7.4.280.0000.00816.46
7.4.270.0050.00316.37
7.4.260.0040.00716.60
7.4.250.0040.00416.49
7.4.240.0060.00116.49
7.4.230.0070.00016.63
7.4.220.0060.01216.62
7.4.210.0100.01016.61
7.4.200.0050.00216.61
7.4.160.0100.00716.44
7.4.150.0030.01317.40
7.4.140.0070.01217.86
7.4.130.0090.00816.64
7.4.120.0140.00516.42
7.4.110.0030.01316.46
7.4.100.0100.01316.50
7.4.90.0130.00916.54
7.4.80.0060.01219.39
7.4.70.0060.01216.58
7.4.60.0060.01016.47
7.4.50.0040.00416.48
7.4.40.0060.01016.57
7.4.30.0130.00616.53
7.4.00.0070.00715.18
7.3.330.0030.00213.23
7.3.320.0000.00513.24
7.3.310.0030.00416.41
7.3.300.0000.00716.41
7.3.290.0080.00716.31
7.3.280.0060.01016.36
7.3.270.0110.01117.40
7.3.260.0140.00316.70
7.3.250.0090.00816.40
7.3.240.0100.00716.32
7.3.230.0090.01216.39
7.3.210.0100.00716.41
7.3.200.0090.01216.49
7.3.190.0040.01216.23
7.3.180.0030.01216.52
7.3.170.0160.00316.43
7.3.160.0070.01316.53
7.2.330.0080.00916.79
7.2.320.0090.00816.41
7.2.310.0060.00916.75
7.2.300.0130.01116.25
7.2.290.0070.01016.60
7.2.60.0100.00716.80
7.2.00.0040.01119.12
7.1.200.0070.00715.43
7.1.100.0040.00717.51
7.1.70.0040.00417.14
7.1.60.0110.01119.42
7.1.50.0070.01716.95
7.1.00.0100.07022.54
7.0.200.0160.00416.74
7.0.60.0070.03719.96
7.0.50.0030.04717.96
7.0.40.0000.05020.30
7.0.30.0300.07020.15
7.0.20.0230.07720.11
7.0.10.0070.08320.27
7.0.00.0030.04320.10
5.6.280.0000.06321.05
5.6.210.0030.04320.51
5.6.200.0070.06718.23
5.6.190.0070.04720.57
5.6.180.0630.06020.67
5.6.170.0100.07720.45
5.6.160.0100.07720.55
5.6.150.0030.08718.19
5.6.140.0030.07718.23
5.6.130.0100.05318.18
5.6.120.0130.07721.09
5.6.110.0070.04721.07
5.6.100.0030.06721.16
5.6.90.0130.07321.18
5.6.80.0030.05320.44
5.5.350.4230.04320.44
5.5.340.0130.06318.09
5.5.330.0070.08020.46
5.5.320.0230.04720.52
5.5.310.0270.05020.45
5.5.300.0070.08017.98
5.5.290.0100.07318.16
5.5.280.0030.09320.86
5.5.270.0030.04020.91
5.5.260.0100.07720.92
5.5.250.0030.04720.72
5.5.240.0070.07320.25
5.4.450.1000.05019.77
5.4.440.1030.06319.43
5.4.430.0870.05319.66
5.4.420.0700.05319.48
5.4.410.0630.05719.40
5.4.400.0670.05319.28
5.4.390.0670.05719.34
5.4.380.0830.05019.16
5.4.370.0900.05319.31
5.4.360.1070.05018.91
5.4.350.0830.05719.11
5.4.340.1070.07019.44
5.4.320.0900.05019.20
5.4.310.0870.06719.34
5.4.300.0900.05719.34
5.4.290.1000.06319.20
5.4.280.0900.05019.33
5.4.270.0930.04719.35
5.4.260.0930.05719.16
5.4.250.0730.04719.33
5.4.240.0670.05318.86
5.4.230.0530.06019.08
5.4.220.0730.05319.33
5.4.210.0900.05019.04
5.4.200.0830.05016.81
5.4.190.0830.04719.29
5.4.180.0770.05319.15
5.4.170.0830.04719.18
5.4.160.0800.03719.13
5.4.150.0670.04319.02
5.4.140.0730.04716.61
5.4.130.0970.04716.43
5.4.120.0870.04716.38
5.4.110.0830.05016.59
5.4.100.0900.05716.58
5.4.90.0830.06716.54
5.4.80.0970.04016.55
5.4.70.0770.05016.44
5.4.60.0730.04716.37
5.4.50.0800.07316.55
5.4.40.0800.04716.40
5.4.30.0630.05316.44
5.4.20.0630.06716.43
5.4.10.0770.04316.72
5.4.00.0670.05716.07
5.3.290.0670.05714.69
5.3.280.0770.06014.56
5.3.270.0800.05014.59
5.3.260.1030.04014.62
5.3.250.0930.04314.54
5.3.240.0670.04314.51
5.3.230.0130.05014.74
5.3.220.0100.05014.61
5.3.210.0600.05014.50
5.3.200.0830.06014.73
5.3.190.0130.05714.47
5.3.180.0100.05314.61
5.3.170.0330.05714.78
5.3.160.0870.06014.47
5.3.150.0830.06014.46
5.3.140.0730.05314.59
5.3.130.0770.04714.45
5.3.120.0830.05014.46
5.3.110.0630.06014.41
5.3.100.0730.06314.01
5.3.90.0800.05013.93
5.3.80.0570.05714.24
5.3.70.0630.05014.03
5.3.60.0800.04714.02
5.3.50.0670.05013.88
5.3.40.0970.04714.10
5.3.30.0730.05713.82
5.3.20.0770.04713.70
5.3.10.0870.04013.88
5.3.00.0770.05313.54
5.2.170.0730.04011.05
5.2.160.0730.03011.20
5.2.150.0530.04011.07
5.2.140.0600.05011.10
5.2.130.0730.04011.16
5.2.120.0700.03711.07
5.2.110.0630.04311.00
5.2.100.0700.04011.25
5.2.90.0730.04011.01
5.2.80.0600.05011.00
5.2.70.0230.06011.16
5.2.60.0070.05010.96
5.2.50.0200.04711.25
5.2.40.0130.04711.08
5.2.30.0470.04010.88
5.2.20.0400.04310.88
5.2.10.0400.03310.81
5.2.00.0470.04710.64
5.1.60.0300.03710.04
5.1.50.0100.0309.92
5.1.40.0030.0379.82
5.1.30.0170.03010.39
5.1.20.0470.03010.36
5.1.10.0500.0309.96
5.1.00.0200.04010.15
5.0.50.0030.0308.80
5.0.40.0030.0278.36
5.0.30.0130.0478.26
5.0.20.0270.0238.14
5.0.10.0300.0278.19
5.0.00.0270.0408.06
4.4.90.0170.0205.77
4.4.80.0370.0175.84
4.4.70.0170.0335.79
4.4.60.0230.0305.75
4.4.50.0300.0205.84
4.4.40.0200.0375.85
4.4.30.0230.0305.87
4.4.20.0300.0205.83
4.4.10.0270.0205.83
4.4.00.0270.0335.90
4.3.110.0100.0235.77
4.3.100.0230.0175.76
4.3.90.0270.0175.78
4.3.80.0330.0405.69
4.3.70.0370.0205.75
4.3.60.0300.0275.65
4.3.50.0370.0275.73
4.3.40.0170.0435.64
4.3.30.0170.0234.43
4.3.20.0100.0274.58
4.3.10.0170.0204.43
4.3.00.0170.0308.43

preferences:
49.14 ms | 401 KiB | 5 Q