3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getKey($seed='no seed??') { return hash('sha256', $seed, 1); } function encrypt($key, $string) { $size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($size, MCRYPT_RAND); $encrypted_string = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $string, MCRYPT_MODE_CBC, $iv); return base64_encode($iv . $encrypted_string); } function decrypt($key, $encoded_string) { $binary = base64_decode($encoded_string); $size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); $iv = substr($binary, 0, $size); $encrypted_string = substr($binary, $size); return mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted_string, MCRYPT_MODE_CBC, $iv); } $key = getKey('Some Secret String'); $encrypted = encrypt($key, 'This is a string that will be encrypted'); echo decrypt($key, $encrypted);

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.0090.00618.55
8.3.50.0090.01121.27
8.3.40.0140.00018.91
8.3.30.0070.00719.23
8.3.20.0060.00320.36
8.3.10.0050.00221.97
8.3.00.0040.00420.79
8.2.180.0150.00017.00
8.2.170.0110.00722.96
8.2.160.0170.00319.21
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0060.00319.48
8.2.110.0030.00622.20
8.2.100.0110.00417.91
8.2.90.0090.00019.09
8.2.80.0000.00817.97
8.2.70.0080.00017.50
8.2.60.0050.00317.80
8.2.50.0000.00818.07
8.2.40.0030.00519.82
8.2.30.0000.01018.06
8.2.20.0070.00017.73
8.2.10.0030.00517.71
8.2.00.0080.00017.73
8.1.280.0140.00325.92
8.1.270.0050.00322.20
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00723.78
8.1.230.0040.00819.02
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0040.00417.39
8.1.180.0070.00018.75
8.1.170.0050.00318.29
8.1.160.0000.00722.13
8.1.150.0000.00818.55
8.1.140.0050.00217.46
8.1.130.0080.00017.89
8.1.120.0000.00717.40
8.1.110.0050.00317.48
8.1.100.0040.00417.32
8.1.90.0040.00417.40
8.1.80.0070.00017.30
8.1.70.0000.00717.34
8.1.60.0000.00817.56
8.1.50.0040.00417.59
8.1.40.0040.00417.61
8.1.30.0050.00217.62
8.1.20.0000.00817.73
8.1.10.0050.00217.46
8.1.00.0000.00717.54
8.0.300.0000.00918.77
8.0.290.0000.00717.04
8.0.280.0050.00318.36
8.0.270.0070.00017.16
8.0.260.0060.00016.69
8.0.250.0070.00016.93
8.0.240.0040.00417.02
8.0.230.0000.00816.94
8.0.220.0040.00416.89
8.0.210.0000.00716.85
8.0.200.0000.00616.85
8.0.190.0080.00016.87
8.0.180.0050.00316.92
8.0.170.0040.00416.81
8.0.160.0040.00416.86
8.0.150.0030.00416.80
8.0.140.0000.00816.84
8.0.130.0050.00013.31
8.0.120.0000.01016.86
8.0.110.0040.00416.80
8.0.100.0000.00716.96
8.0.90.0050.00316.72
8.0.80.0030.01916.85
8.0.70.0040.00416.71
8.0.60.0070.00016.73
8.0.50.0000.00816.69
8.0.30.0160.00317.11
8.0.20.0140.01017.43
8.0.10.0070.00016.92
8.0.00.0070.01116.63
7.4.330.0060.00015.03
7.4.320.0000.00616.46
7.4.300.0030.00316.60
7.4.290.0000.00716.58
7.4.280.0030.00316.63
7.4.270.0060.00016.39
7.4.260.0030.00316.60
7.4.250.0080.00016.51
7.4.240.0020.00516.59
7.4.230.0000.00716.32
7.4.220.0090.00916.50
7.4.210.0110.00416.56
7.4.200.0000.00716.55
7.4.190.0030.00316.48
7.4.160.0100.00616.45
7.4.150.0000.01717.40
7.4.140.0050.01217.86
7.4.130.0130.00916.60
7.4.120.0100.00716.55
7.4.110.0140.00316.52
7.4.100.0110.00716.51
7.4.90.0130.00716.58
7.4.80.0150.00319.39
7.4.70.0030.01416.40
7.4.60.0120.00416.45
7.4.50.0030.00616.34
7.4.40.0100.00522.77
7.4.30.0080.00816.57
7.4.00.0090.00615.20
7.3.330.0050.00013.34
7.3.320.0050.00013.29
7.3.310.0040.00416.33
7.3.300.0000.00616.33
7.3.290.0040.01716.27
7.3.280.0110.00516.31
7.3.270.0040.01217.40
7.3.260.0110.00616.53
7.3.250.0070.01116.44
7.3.240.0040.01416.54
7.3.230.0090.00916.39
7.3.210.0120.00616.46
7.3.200.0100.01019.39
7.3.190.0160.00316.60
7.3.180.0030.01216.42
7.3.170.0160.00416.44
7.3.160.0100.00916.42
7.3.120.0030.01014.97
7.3.10.0080.00816.84
7.3.00.0080.00316.66
7.2.330.0090.00916.73
7.2.320.0130.00616.37
7.2.310.0080.01216.59
7.2.300.0150.00616.73
7.2.290.0060.00916.36
7.2.130.0080.00516.80
7.2.120.0070.00816.81
7.2.110.0160.00016.65
7.2.100.0050.00816.55
7.2.90.0080.00816.66
7.2.80.0080.00816.76
7.2.70.0090.00416.79
7.2.60.0100.00916.89
7.2.50.0070.00716.87
7.2.40.0080.00816.78
7.2.30.0050.01116.74
7.2.20.0050.00716.77
7.2.10.0050.00916.85
7.2.00.0040.00916.65
7.1.250.0010.01115.80
7.1.240.0060.01015.68
7.1.230.0100.00715.52
7.1.220.0130.00315.79
7.1.210.0040.01115.80
7.1.200.0010.01115.85
7.1.190.0070.01015.75
7.1.180.0070.00715.66
7.1.170.0070.00715.68
7.1.160.0040.00715.56
7.1.150.0000.01015.71
7.1.140.0000.01415.69
7.1.130.0000.01015.68
7.1.120.0060.00615.87
7.1.110.0060.00815.75
7.1.100.0020.00916.82
7.1.90.0070.00715.68
7.1.80.0040.01215.85
7.1.70.0020.01016.25
7.1.60.0130.00517.77
7.1.50.0110.00716.42
7.1.40.0030.01015.53
7.1.30.0070.00715.67
7.1.20.0060.00815.82
7.1.10.0040.00815.44
7.1.00.0050.04319.13
7.0.330.0120.00315.54
7.0.320.0030.01015.37
7.0.310.0000.00915.26
7.0.300.0040.01115.23
7.0.290.0060.00715.45
7.0.280.0040.01115.31
7.0.270.0060.00615.07
7.0.260.0080.00615.20
7.0.250.0060.00615.43
7.0.240.0030.01315.42
7.0.230.0030.00915.17
7.0.220.0040.01115.21
7.0.210.0060.00615.49
7.0.200.0020.01016.09
7.0.190.0030.00615.41
7.0.180.0040.01115.46
7.0.170.0000.01215.29
7.0.160.0060.00615.05
7.0.150.0110.00315.29
7.0.140.0060.04018.70
7.0.130.0070.00715.59
7.0.120.0070.00414.99
7.0.110.0090.00615.52
7.0.100.0060.00915.28
7.0.90.0000.00815.43
7.0.80.0000.01115.14
7.0.70.0060.00615.55
7.0.60.0120.04017.61
7.0.50.0050.04816.74
7.0.40.0050.03516.90
7.0.30.0150.03516.68
7.0.20.0120.04716.75
7.0.10.0050.04416.84
7.0.00.0060.03516.96
5.6.380.0040.00814.02
5.6.370.0060.00614.29
5.6.360.0000.01414.33
5.6.350.0130.00314.33
5.6.340.0000.01614.34
5.6.330.0060.00314.42
5.6.320.0110.00314.27
5.6.310.0090.00613.92
5.6.300.0030.01314.39
5.6.290.0030.00714.03
5.6.280.0080.03617.48
5.6.270.0000.01613.80
5.6.260.0040.00714.18
5.6.250.0030.01014.17
5.6.240.0060.00914.14
5.6.230.0060.00613.88
5.6.220.0000.01414.16
5.6.210.0060.04017.43
5.6.200.0040.04716.22
5.6.190.0050.04617.38
5.6.180.0050.03017.49
5.6.170.0100.03417.41
5.6.160.0170.02317.27
5.6.150.0050.03916.29
5.6.140.0100.04016.26
5.6.130.0050.02316.14
5.6.120.0060.03317.58
5.6.110.0100.04217.52
5.6.100.0030.04717.66
5.6.90.0090.04417.66
5.6.80.0040.03117.36
5.6.70.0000.01014.21
5.6.60.0110.00314.20
5.6.50.0070.00714.34
5.6.40.0070.00714.15
5.6.30.0090.00614.04
5.6.20.0070.00714.03
5.6.10.0080.00414.30
5.6.00.0060.00614.38
5.5.380.0030.00711.18
5.5.370.0000.00711.18
5.5.360.0040.00411.18
5.5.350.0170.04515.84
5.5.340.0030.02514.63
5.5.330.0030.03815.87
5.5.320.0150.03815.85
5.5.310.0220.03815.74
5.5.300.0060.02614.59
5.5.290.0000.03614.63
5.5.280.0080.02816.12
5.5.270.0070.03516.06
5.5.260.0070.04016.03
5.5.250.0080.02815.94
5.5.240.0030.03715.72
5.5.230.0040.00711.18
5.5.220.0100.00011.18
5.5.210.0030.00311.18
5.5.200.0040.00811.18
5.5.190.0030.00911.18
5.5.180.0030.00311.18
5.5.170.0110.00011.18
5.5.160.0000.00611.18
5.5.150.0030.00911.18
5.5.140.0030.00811.18
5.5.130.0030.00711.18
5.5.120.0030.00511.18
5.5.110.0040.00811.20
5.5.100.0070.00311.18
5.5.90.0030.00311.18
5.5.80.0030.00711.18
5.5.70.0100.00011.18
5.5.60.0120.00011.18
5.5.50.0000.00611.18
5.5.40.0030.01011.18
5.5.30.0000.00911.18
5.5.20.0000.01011.18
5.5.10.0040.00711.18
5.5.00.0040.00711.18
5.4.450.0910.02615.39
5.4.440.0810.02315.30
5.4.430.0910.01815.29
5.4.420.0820.01515.39
5.4.410.0990.01815.22
5.4.400.0910.02215.21
5.4.390.0930.02415.18
5.4.380.0820.02015.22
5.4.370.0950.02115.04
5.4.360.0890.01815.15
5.4.350.0980.01615.19
5.4.340.0800.02015.11
5.4.330.0000.01211.18
5.4.320.0900.01915.11
5.4.310.0920.01815.21
5.4.300.0930.02515.03
5.4.290.0940.02215.02
5.4.280.1170.01815.21
5.4.270.1080.02015.04
5.4.260.1000.02715.02
5.4.250.0950.01815.26
5.4.240.1020.02515.27
5.4.230.0010.04115.13
5.4.220.0060.02015.02
5.4.210.0020.03915.22
5.4.200.0530.03315.22
5.4.190.1020.02715.15
5.4.180.0930.02015.04
5.4.170.1020.02715.15
5.4.160.1040.02215.07
5.4.150.0880.02315.20
5.4.140.0900.02313.89
5.4.130.1050.02313.86
5.4.120.1060.02313.84
5.4.110.0970.01913.84
5.4.100.0650.01813.89
5.4.90.0020.04013.74
5.4.80.0000.02713.72
5.4.70.0730.01813.76
5.4.60.0980.02613.77
5.4.50.1090.02213.88
5.4.40.1210.02313.85
5.4.30.1100.02313.83
5.4.20.1050.02813.82
5.4.10.1080.02213.77
5.4.00.1040.02413.50
5.3.290.0980.01812.88
5.3.280.1170.02212.84
5.3.270.1050.02012.90
5.3.260.1080.02112.85
5.3.250.1150.02412.85
5.3.240.1000.02212.93
5.3.230.0980.01612.89
5.3.220.1100.02712.83
5.3.210.0950.02212.88
5.3.200.1030.02212.82
5.3.190.0980.01812.93
5.3.180.0920.02312.83
5.3.170.0970.02212.99
5.3.160.1080.01812.88
5.3.150.1180.02812.88
5.3.140.0970.02312.82
5.3.130.0180.03612.85
5.3.120.0080.03812.92
5.3.110.0080.04012.92
5.3.100.0360.02412.61
5.3.90.1050.01812.59
5.3.80.1000.02512.63
5.3.70.1010.01512.68
5.3.60.1080.02812.67
5.3.50.1110.01712.63
5.3.40.0880.02212.55
5.3.30.0050.01812.57
5.3.20.0100.03312.43
5.3.10.0100.03312.49
5.3.00.0850.02912.37
5.2.170.0780.01511.12
5.2.160.0780.01711.21
5.2.150.0780.01811.28
5.2.140.0900.02111.21
5.2.130.0870.02211.10
5.2.120.0930.01511.18
5.2.110.0770.02111.15
5.2.100.0930.01711.10
5.2.90.0810.01311.16
5.2.80.0830.02111.10
5.2.70.0030.02011.10
5.2.60.0020.01911.07
5.2.50.0030.02311.16
5.2.40.0630.02411.16
5.2.30.0770.01611.08
5.2.20.0630.02211.04
5.2.10.0740.02011.01
5.2.00.0780.02110.98
5.1.60.0730.01610.71
5.1.50.0680.00810.53
5.1.40.0730.01710.54
5.1.30.0780.01210.80
5.1.20.0650.01810.75
5.1.10.0760.01610.57
5.1.00.0630.01710.58
5.0.50.0380.0169.98
5.0.40.0350.0109.84
5.0.30.0390.0249.65
5.0.20.0300.0149.70
5.0.10.0440.0159.64
5.0.00.0400.0189.71
4.4.90.0350.0129.62
4.4.80.0320.0109.62
4.4.70.0360.0089.62
4.4.60.0330.0089.62
4.4.50.0370.0119.62
4.4.40.0320.0159.62
4.4.30.0430.0139.62
4.4.20.0350.0129.62
4.4.10.0330.0129.62
4.4.00.0340.0159.62
4.3.110.0380.0169.62
4.3.100.0370.0109.62
4.3.90.0330.0089.62
4.3.80.0250.0139.62
4.3.70.0330.0089.62
4.3.60.0450.0129.62
4.3.50.0380.0129.62
4.3.40.0380.0139.62
4.3.30.0180.0099.62
4.3.20.0180.0139.62
4.3.10.0100.0139.62
4.3.00.0040.0109.62

preferences:
35.77 ms | 401 KiB | 5 Q