3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encode($string,$key) { $key = sha1($key); $strLen = strlen($string); $keyLen = strlen($key); for ($i = 0; $i < $strLen; $i++) { $ordStr = ord(substr($string,$i,1)); if ($j == $keyLen) { $j = 0; } $ordKey = ord(substr($key,$j,1)); $j++; $hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36)); } return $hash; } function decode($string,$key) { $key = sha1($key); $strLen = strlen($string); $keyLen = strlen($key); for ($i = 0; $i < $strLen; $i+=2) { $ordStr = hexdec(base_convert(strrev(substr($string,$i,2)),36,16)); if ($j == $keyLen) { $j = 0; } $ordKey = ord(substr($key,$j,1)); $j++; $hash .= chr($ordStr - $ordKey); } return $hash; } echo encode("i:1:1",3029); echo decode(encode("i:1:1"),3029); ?>

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.0080.00818.18
8.3.50.0100.00721.98
8.3.40.0040.01119.04
8.3.30.0140.00318.60
8.3.20.0050.00318.91
8.3.10.0030.00621.13
8.3.00.0070.00021.82
8.2.180.0140.00716.63
8.2.170.0110.00422.96
8.2.160.0030.01320.22
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0090.00021.07
8.2.110.0030.00620.38
8.2.100.0070.00417.84
8.2.90.0000.00819.35
8.2.80.0030.00617.97
8.2.70.0080.00017.75
8.2.60.0080.00018.04
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0040.00421.32
8.2.20.0060.00317.72
8.2.10.0000.00717.80
8.2.00.0030.00617.87
8.1.280.0120.00325.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0110.00022.42
8.1.230.0080.00321.04
8.1.220.0030.00518.77
8.1.210.0030.00518.77
8.1.200.0050.00517.25
8.1.190.0050.00317.65
8.1.180.0030.00618.10
8.1.170.0030.00518.43
8.1.160.0030.00618.89
8.1.150.0040.00418.64
8.1.140.0000.00817.50
8.1.130.0040.00417.82
8.1.120.0000.00717.34
8.1.110.0060.00317.42
8.1.100.0080.00017.44
8.1.90.0070.00017.39
8.1.80.0030.00517.47
8.1.70.0000.00717.46
8.1.60.0090.00017.65
8.1.50.0040.00417.44
8.1.40.0070.00017.50
8.1.30.0040.00417.58
8.1.20.0000.00817.70
8.1.10.0000.00817.64
8.1.00.0070.00417.51
8.0.300.0070.00020.08
8.0.290.0000.00917.18
8.0.280.0000.00718.35
8.0.270.0030.00317.27
8.0.260.0070.00016.84
8.0.250.0040.00416.97
8.0.240.0030.00617.02
8.0.230.0030.00316.91
8.0.220.0080.00016.83
8.0.210.0000.00717.01
8.0.200.0090.00016.88
8.0.190.0040.00417.01
8.0.180.0040.00416.97
8.0.170.0000.00816.90
8.0.160.0050.00217.00
8.0.150.0000.00816.89
8.0.140.0050.00316.94
8.0.130.0030.00313.40
8.0.120.0050.00316.95
8.0.110.0040.00416.93
8.0.100.0050.00316.77
8.0.90.0040.00416.99
8.0.80.0060.00917.00
8.0.70.0000.00716.85
8.0.60.0040.00416.82
8.0.50.0040.00416.94
8.0.30.0120.00517.02
8.0.20.0130.00517.40
8.0.10.0060.00317.08
8.0.00.0050.01216.91
7.4.330.0060.00014.73
7.4.320.0070.00016.50
7.4.300.0030.00316.45
7.4.290.0030.00316.56
7.4.280.0000.00716.55
7.4.270.0000.00816.45
7.4.260.0050.00013.24
7.4.250.0040.00416.37
7.4.240.0000.00716.66
7.4.230.0030.00316.49
7.4.220.0090.00916.58
7.4.210.0100.00816.51
7.4.200.0030.00516.25
7.4.190.0040.00416.51
7.4.160.0150.00616.61
7.4.150.0060.01217.40
7.4.140.0130.00517.86
7.4.130.0060.01616.64
7.4.120.0070.01016.56
7.4.110.0120.01216.28
7.4.100.0160.00516.58
7.4.90.0130.00916.52
7.4.80.0060.01219.39
7.4.70.0100.00816.64
7.4.60.0170.01416.64
7.4.50.0040.00416.61
7.4.40.0040.01522.77
7.4.30.0110.00516.54
7.4.00.0090.00614.92
7.3.330.0050.00013.49
7.3.320.0000.00513.23
7.3.310.0000.00716.52
7.3.300.0030.00316.46
7.3.290.0090.00916.40
7.3.280.0080.00816.37
7.3.270.0080.00817.40
7.3.260.0140.01018.24
7.3.250.0100.00816.41
7.3.240.0050.01116.45
7.3.230.0070.01016.39
7.3.210.0130.00716.41
7.3.200.0140.00419.39
7.3.190.0080.00816.38
7.3.180.0040.01216.38
7.3.170.0100.00516.59
7.3.160.0030.01316.39
7.3.120.0040.01115.00
7.3.00.0080.00416.69
7.2.330.0030.01416.57
7.2.320.0090.01216.78
7.2.310.0070.01016.61
7.2.300.0030.01316.84
7.2.290.0070.01016.62
7.2.130.0090.00317.05
7.2.120.0030.01016.68
7.2.110.0110.00716.68
7.2.100.0040.00917.00
7.2.90.0000.01217.04
7.2.80.0040.00716.71
7.2.70.0030.01016.92
7.2.60.0050.01016.87
7.2.50.0070.01016.99
7.2.40.0060.00617.03
7.2.30.0030.01316.96
7.2.20.0030.01016.89
7.2.10.0060.01016.73
7.2.00.0040.01018.15
7.1.250.0040.00715.84
7.1.240.0100.00715.87
7.1.230.0080.00315.81
7.1.220.0100.00315.82
7.1.210.0000.01315.81
7.1.200.0050.00915.71
7.1.190.0040.00415.61
7.1.180.0100.00315.89
7.1.170.0000.01215.58
7.1.160.0120.00315.46
7.1.150.0060.00315.78
7.1.140.0030.00715.72
7.1.130.0000.01215.87
7.1.120.0070.00415.59
7.1.110.0040.00815.92
7.1.100.0000.01017.01
7.1.90.0040.00715.56
7.1.80.0030.00615.85
7.1.70.0040.00516.49
7.1.60.0040.01117.57
7.1.50.0070.01116.22
7.1.40.0030.00615.84
7.1.30.0110.00015.57
7.1.20.0070.00415.79
7.1.10.0100.00015.74
7.1.00.0030.02319.11
7.0.330.0070.00315.45
7.0.320.0130.00315.42
7.0.310.0120.00015.45
7.0.300.0000.01315.47
7.0.290.0000.01415.26
7.0.280.0060.00615.38
7.0.270.0000.01015.56
7.0.260.0060.00615.55
7.0.250.0000.01015.56
7.0.240.0140.00015.34
7.0.230.0060.00915.36
7.0.220.0170.00715.26
7.0.210.0040.00715.30
7.0.200.0080.00215.94
7.0.190.0030.00715.12
7.0.180.0050.00515.41
7.0.170.0100.00015.29
7.0.160.0070.00715.49
7.0.150.0000.00915.59
7.0.140.0040.04018.69
7.0.130.0030.00715.46
7.0.120.0100.00315.43
7.0.110.0000.01015.54
7.0.100.0060.00615.33
7.0.90.0270.03517.76
7.0.80.0270.02717.61
7.0.70.0420.03417.64
7.0.60.0280.04717.61
7.0.50.0400.03817.86
7.0.40.0060.03816.74
7.0.30.0060.04416.94
7.0.20.0060.04016.88
7.0.10.0070.04116.84
7.0.00.0030.03916.61
5.6.380.0100.00614.25
5.6.370.0060.00614.67
5.6.360.0070.00414.54
5.6.350.0070.00714.63
5.6.340.0060.00614.31
5.6.330.0060.00614.44
5.6.320.0090.00614.21
5.6.310.0060.00614.19
5.6.300.0060.00614.28
5.6.290.0060.00914.28
5.6.280.0040.03617.94
5.6.270.0000.00814.29
5.6.260.0040.00414.32
5.6.250.0070.00714.05
5.6.240.0030.00914.53
5.6.230.0110.03517.50
5.6.220.0080.04517.44
5.6.210.0090.04117.49
5.6.200.0070.05017.74
5.6.190.0050.03217.54
5.6.180.0080.04417.57
5.6.170.0100.04417.68
5.6.160.0050.03617.48
5.6.150.0140.02017.75
5.6.140.0040.04717.63
5.6.130.0070.04517.63
5.6.120.0050.02817.78
5.6.110.0070.03817.78
5.6.100.0110.03517.58
5.6.90.0040.03717.56
5.6.80.0070.04217.27
5.6.70.0060.03317.46
5.6.60.0100.04317.46
5.6.50.0040.02917.32
5.6.40.0060.02517.43
5.6.30.0150.03217.26
5.6.20.0030.04817.43
5.6.10.0070.02817.40
5.6.00.0120.03517.21
5.5.380.0030.00511.30
5.5.370.0060.02815.79
5.5.360.0040.04715.93
5.5.350.0080.04015.84
5.5.340.0010.03315.96
5.5.330.0020.04916.05
5.5.320.0090.03216.06
5.5.310.0030.04416.02
5.5.300.0040.04916.01
5.5.290.0050.02916.00
5.5.280.0060.04415.90
5.5.270.0060.03415.96
5.5.260.0040.02815.92
5.5.250.0030.04715.86
5.5.240.0040.04415.78
5.5.230.0000.03415.52
5.5.220.0030.04515.81
5.5.210.0080.02615.60
5.5.200.0030.04515.72
5.5.190.0040.04315.48
5.5.180.0050.02515.73
5.5.170.0000.00910.92
5.5.160.0050.03315.36
5.5.150.0080.02815.71
5.5.140.0030.04315.63
5.5.130.0090.04015.63
5.5.120.0100.03815.49
5.5.110.0080.02315.56
5.5.100.0070.02315.57
5.5.90.0080.04015.53
5.5.80.0070.03515.48
5.5.70.0020.02615.53
5.5.60.0050.03015.53
5.5.50.0090.03715.50
5.5.40.0110.03615.34
5.5.30.0070.04115.48
5.5.20.0030.04515.55
5.5.10.0070.04415.62
5.5.00.0030.04215.69
5.4.450.0050.04315.34
5.4.440.0050.03415.22
5.4.430.0030.04115.16
5.4.420.0050.04215.16
5.4.410.0050.02315.29
5.4.400.0050.03915.10
5.4.390.0030.03715.15
5.4.380.0050.02915.00
5.4.370.0070.04215.19
5.4.360.0100.01815.11
5.4.350.0070.03815.00
5.4.340.0030.02815.11
5.4.330.0030.00711.19
5.4.320.0070.03715.00
5.4.310.0070.04014.86
5.4.300.0070.04015.04
5.4.290.0080.02314.98
5.4.280.0060.04214.93
5.4.270.0040.04115.13
5.4.260.0030.03715.09
5.4.250.0080.03315.01
5.4.240.0060.02614.99
5.4.230.0030.03115.10
5.4.220.0020.03415.21
5.4.210.0020.04315.05
5.4.200.0070.03314.95
5.4.190.0080.02714.94
5.4.180.0060.04115.01
5.4.170.0040.04515.30
5.4.160.0020.04615.03
5.4.150.0050.04514.90
5.4.140.0080.03813.64
5.4.130.0090.03713.82
5.4.120.0050.03913.87
5.4.110.0020.04013.82
5.4.100.0030.04513.79
5.4.90.0030.03213.82
5.4.80.0060.03113.91
5.4.70.0030.04213.76
5.4.60.0050.02713.88
5.4.50.0050.03813.72
5.4.40.0020.04213.75
5.4.30.0030.04413.78
5.4.20.0040.04013.81
5.4.10.0070.03813.83
5.4.00.0040.03413.47
5.3.290.0030.03112.71
5.3.280.0050.02212.63
5.3.270.0050.04212.60
5.3.260.0170.02812.60
5.3.250.0020.04712.56
5.3.240.0070.04012.54
5.3.230.0070.03912.55
5.3.220.0090.02312.60
5.3.210.0040.02312.61
5.3.200.0020.02812.53
5.3.190.0020.03012.61
5.3.180.0030.04112.63
5.3.170.0070.03812.69
5.3.160.0030.04012.54
5.3.150.0080.03612.66
5.3.140.0050.02312.55
5.3.130.0080.03512.56
5.3.120.0030.02312.65
5.3.110.0020.02812.60
5.3.100.0050.04212.36
5.3.90.0000.03312.39
5.3.80.0020.04112.37
5.3.70.0000.04012.15
5.3.60.0030.04112.42
5.3.50.0050.04012.31
5.3.40.0080.03712.15
5.3.30.0040.03212.27
5.3.20.0080.03812.21
5.3.10.0030.03912.07
5.3.00.0040.04212.00
5.2.170.0020.03311.76
5.2.160.0020.03811.76
5.2.150.0020.02211.76
5.2.140.0090.02711.76
5.2.130.0070.02811.76
5.2.120.0050.03111.76
5.2.110.0050.03311.76
5.2.100.0060.03311.76
5.2.90.0050.03311.76
5.2.80.0050.03011.76
5.2.70.0020.03511.76
5.2.60.0050.03011.76
5.2.50.0030.03611.76
5.2.40.0050.03211.76
5.2.30.0070.02511.76
5.2.20.0070.02811.76
5.2.10.0050.03011.77
5.2.00.0000.03711.77
5.1.60.0030.03011.77
5.1.50.0060.02311.77
5.1.40.0020.03111.77
5.1.30.0050.02911.77
5.1.20.0000.03311.77
5.1.10.0020.02811.77
5.1.00.0060.02611.77
5.0.50.0030.02311.77
5.0.40.0030.02311.77
5.0.30.0020.03011.77
5.0.20.0030.02411.77
5.0.10.0020.02411.77
5.0.00.0060.03311.77
4.4.90.0000.02011.76
4.4.80.0020.02011.76
4.4.70.0050.01711.76
4.4.60.0040.01711.76
4.4.50.0020.02011.76
4.4.40.0020.02911.77
4.4.30.0010.02111.77
4.4.20.0000.02311.77
4.4.10.0020.01711.77
4.4.00.0030.02811.77
4.3.110.0030.01811.77
4.3.100.0000.01711.77
4.3.90.0060.01511.77
4.3.80.0020.02411.77
4.3.70.0040.01511.77
4.3.60.0030.01711.77
4.3.50.0030.01311.77
4.3.40.0030.02511.77
4.3.30.0030.02011.77
4.3.20.0030.02011.77
4.3.10.0020.01411.77
4.3.00.0000.01511.77

preferences:
41 ms | 401 KiB | 5 Q