3v4l.org

run code in 300+ PHP versions simultaneously
<?php // https://trello.com/jobs/windows-mobile-developer $alphabet = 'acdegilmnoprstuw'; // test data $hash = 680131659347; $string = 'leepadg'; $task_hash = 696005871397; echo sprintf('Hash of string «%s» is «%s».', $string, get_hash($alphabet, $string)) , PHP_EOL , sprintf('String of hash «%s» is «%s».', $hash, unhash($alphabet, $hash)) , PHP_EOL , sprintf('Solution for hash «%s» is «%s».', $task_hash, unhash($alphabet, $task_hash)) ; function get_hash($alphabet, $string) { $h = 7; $len = strlen($string); for($i = 0; $i < $len; $i++) { $h = ($h * 37 + strpos($alphabet, $string[$i])); } return $h; } function unhash($alphabet, $hash) { $result = ''; $len = strlen($alphabet); while ($hash > 7) { for ($i = 0; $i < $len; $i++) { $newres = ($hash - $i) / 37; if (is_int($newres)) { $result .= $alphabet[$i]; $hash = $newres; break; } } } return strrev($result); }

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.0150.00616.75
8.3.50.0120.00521.99
8.3.40.0120.00318.79
8.3.30.0110.00419.06
8.3.20.0040.00420.39
8.3.10.0080.00021.76
8.3.00.0090.00020.99
8.2.180.0160.00316.50
8.2.170.0070.00722.96
8.2.160.0100.00722.08
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.41
8.2.110.0070.00320.99
8.2.100.0080.00318.03
8.2.90.0000.00819.21
8.2.80.0030.00617.97
8.2.70.0030.00617.63
8.2.60.0000.00917.93
8.2.50.0040.00418.07
8.2.40.0050.00320.07
8.2.30.0000.00718.20
8.2.20.0000.00817.76
8.2.10.0080.00018.21
8.2.00.0000.00717.71
8.1.280.0100.01025.92
8.1.270.0090.00020.79
8.1.260.0040.00426.35
8.1.250.0050.00528.09
8.1.240.0050.00523.73
8.1.230.0040.00722.80
8.1.220.0050.00317.79
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0030.00517.10
8.1.180.0060.00618.10
8.1.170.0030.00518.52
8.1.160.0070.00021.93
8.1.150.0060.00318.76
8.1.140.0000.00717.41
8.1.130.0030.00317.81
8.1.120.0000.00717.47
8.1.110.0030.00617.38
8.1.100.0040.00417.42
8.1.90.0070.00017.44
8.1.80.0000.00717.40
8.1.70.0070.00017.43
8.1.60.0000.01017.49
8.1.50.0030.00617.60
8.1.40.0000.00817.54
8.1.30.0030.00617.59
8.1.20.0040.00417.55
8.1.10.0080.00017.45
8.1.00.0030.00617.42
8.0.300.0090.00018.77
8.0.290.0030.00616.63
8.0.280.0070.00018.38
8.0.270.0000.00717.20
8.0.260.0060.00317.24
8.0.250.0030.00316.91
8.0.240.0050.00316.89
8.0.230.0080.00016.89
8.0.220.0030.00316.77
8.0.210.0000.00716.86
8.0.200.0020.00516.96
8.0.190.0060.00316.92
8.0.180.0000.00716.88
8.0.170.0030.00316.92
8.0.160.0070.00016.77
8.0.150.0050.00216.80
8.0.140.0000.00716.72
8.0.130.0030.00313.27
8.0.120.0040.00416.80
8.0.110.0050.00316.92
8.0.100.0000.00716.88
8.0.90.0030.00316.74
8.0.80.0090.00616.81
8.0.70.0040.00416.82
8.0.60.0040.00416.73
8.0.50.0030.00616.71
8.0.30.0130.00916.95
8.0.20.0140.01417.40
8.0.10.0040.00416.95
8.0.00.0070.01116.92
7.4.330.0030.00315.03
7.4.320.0060.00016.37
7.4.300.0000.00616.43
7.4.290.0000.00716.71
7.4.280.0070.00016.50
7.4.270.0070.00016.43
7.4.260.0000.01016.58
7.4.250.0000.00716.41
7.4.240.0020.00516.56
7.4.230.0030.00316.37
7.4.220.0100.00716.50
7.4.210.0090.01116.57
7.4.200.0000.00816.42
7.4.160.0070.01016.48
7.4.150.0100.01017.40
7.4.140.0210.01417.86
7.4.130.0180.00016.46
7.4.120.0040.01416.64
7.4.110.0130.00316.57
7.4.100.0140.00616.50
7.4.90.0090.00916.50
7.4.80.0070.01516.39
7.4.70.0070.01316.49
7.4.60.0060.01316.53
7.4.50.0000.00716.60
7.4.40.0130.00316.62
7.4.30.0120.00616.57
7.4.00.0070.00715.11
7.3.330.0000.00513.42
7.3.320.0080.00513.27
7.3.310.0030.00316.28
7.3.300.0000.00716.27
7.3.290.0060.01116.38
7.3.280.0080.00916.38
7.3.270.0090.00917.40
7.3.260.0060.01216.42
7.3.250.0080.01016.50
7.3.240.0140.00616.63
7.3.230.0180.00616.39
7.3.210.0130.00716.42
7.3.200.0060.01219.39
7.3.190.0170.00616.47
7.3.180.0070.01016.45
7.3.170.0100.01416.40
7.3.160.0130.00316.35
7.3.10.0060.00916.41
7.3.00.0000.01316.63
7.2.330.0100.00916.45
7.2.320.0140.00316.75
7.2.310.0100.00716.71
7.2.300.0150.00916.74
7.2.290.0070.01016.50
7.2.130.0000.01416.75
7.2.120.0060.00617.10
7.2.110.0110.00316.98
7.2.100.0090.00016.74
7.2.90.0120.00317.23
7.2.80.0000.01416.94
7.2.70.0000.01416.75
7.2.60.0090.00817.02
7.2.50.0070.01116.55
7.2.40.0140.00416.88
7.2.30.0100.00316.79
7.2.20.0090.00916.84
7.2.10.0070.00716.70
7.2.00.0050.01218.11
7.1.250.0040.00415.64
7.1.100.0070.00318.07
7.1.70.0040.00416.93
7.1.60.0030.00919.46
7.1.50.0070.01316.99
7.1.00.0000.08022.44
7.0.200.0060.00616.80
7.0.140.0170.06322.08
7.0.60.0170.05719.86
7.0.50.0070.08317.90
7.0.40.0000.04720.30
7.0.30.0330.07320.23
7.0.20.0270.08020.33
7.0.10.0130.08320.30
7.0.00.0030.08720.17
5.6.280.0000.07720.82
5.6.210.0070.08720.70
5.6.200.0070.04018.16
5.6.190.0000.04320.58
5.6.180.3700.04320.59
5.6.170.0270.05720.56
5.6.160.0000.06720.55
5.6.150.0000.09018.15
5.6.140.0030.07018.21
5.6.130.0130.06718.15
5.6.120.0070.04020.96
5.6.110.0030.06021.02
5.6.100.0000.05721.02
5.6.90.0070.04020.99
5.6.80.0070.07720.43
5.6.70.4330.03020.41
5.5.350.0370.07720.30
5.5.340.0130.07318.07
5.5.330.0000.04320.35
5.5.320.0400.06720.42
5.5.310.0300.08020.34
5.5.300.0000.07317.96
5.5.290.0130.07017.98
5.5.280.0170.06720.89
5.5.270.0030.08320.98
5.5.260.0130.07020.97
5.5.250.0100.08020.50
5.5.240.0270.07020.08
5.4.450.0570.06319.56
5.4.440.0370.06019.20
5.4.430.0400.04019.58
5.4.420.0200.05319.47
5.4.410.0300.05319.07
5.4.400.0300.05019.38
5.4.390.0270.05018.63
5.4.380.0470.05718.47
5.4.370.0300.04718.80
5.4.360.0400.03718.55
5.4.350.0200.08018.51
5.4.340.0300.05018.79
5.4.320.0200.06018.77
5.4.310.0100.06718.56
5.4.300.0170.06718.72
5.4.290.0230.05318.57
5.4.280.0270.06718.77
5.4.270.0330.04718.78
5.4.260.0230.05318.52
5.4.250.0130.07018.80
5.4.240.0170.06018.83
5.4.230.0230.05318.45
5.4.220.0200.06018.69
5.4.210.0230.05718.77
5.4.200.0230.06316.52
5.4.190.0330.04318.57
5.4.180.0300.05718.57
5.4.170.0300.05018.74
5.4.160.0200.05718.71
5.4.150.0200.06318.74
5.4.140.0170.05016.30
5.4.130.0270.04716.30
5.4.120.0130.05016.17
5.4.110.0230.04716.25
5.4.100.0200.07016.30
5.4.90.0170.06016.21
5.4.80.0200.05316.32
5.4.70.0230.05316.17
5.4.60.0130.06316.20
5.4.50.0270.04716.40
5.4.40.0300.05316.21
5.4.30.0170.07316.41
5.4.20.0130.06016.30
5.4.10.0230.05016.26
5.4.00.0200.05015.71
5.3.290.0300.05314.66
5.3.280.0170.06014.71
5.3.270.0130.06014.74
5.3.260.0230.05014.63
5.3.250.0100.06314.71
5.3.240.0270.04714.75
5.3.230.0130.05714.66
5.3.220.0230.05314.63
5.3.210.0170.06014.63
5.3.200.0200.05714.62
5.3.190.0100.06714.63
5.3.180.0370.03714.63
5.3.170.0100.06014.61
5.3.160.0200.05314.79
5.3.150.0300.04014.75
5.3.140.0230.04714.69
5.3.130.0230.05314.76
5.3.120.0170.05714.76
5.3.110.0130.06314.54
5.3.100.0170.06014.07
5.3.90.0270.05314.21
5.3.80.0200.05014.23
5.3.70.0170.05314.01
5.3.60.0300.04014.07
5.3.50.0130.05314.09
5.3.40.0170.05713.99
5.3.30.0200.04714.13
5.3.20.0170.05313.78
5.3.10.0300.03713.68
5.3.00.0200.05713.63
5.2.170.0130.04311.21
5.2.160.0070.05011.16
5.2.150.0200.04011.14
5.2.140.0100.04711.20
5.2.130.0130.04711.21
5.2.120.0130.04311.33
5.2.110.0230.03311.17
5.2.100.0130.04311.21
5.2.90.0130.04311.13
5.2.80.0170.04311.12
5.2.70.0200.04011.15
5.2.60.0230.03711.26
5.2.50.0170.04011.25
5.2.40.0070.04711.06
5.2.30.0170.04011.11
5.2.20.0270.03311.08
5.2.10.0200.03711.07
5.2.00.0170.04010.84
5.1.60.0130.03310.13
5.1.50.0130.04010.04
5.1.40.0100.04010.02
5.1.30.0170.03310.38
5.1.20.0170.03310.58
5.1.10.0130.03710.11
5.1.00.0100.03710.06
5.0.50.0070.0309.52
5.0.40.0130.0239.52
5.0.30.0000.0539.52
5.0.20.0070.0309.52
5.0.10.0100.0279.52
5.0.00.0100.0409.52
4.4.90.0030.0239.52
4.4.80.0030.0239.52
4.4.70.0130.0179.52
4.4.60.0070.0209.52
4.4.50.0070.0209.52
4.4.40.0070.0339.52
4.4.30.0070.0239.52
4.4.20.0070.0239.52
4.4.10.0030.0239.52
4.4.00.0100.0339.52
4.3.110.0030.0239.52
4.3.100.0070.0209.52
4.3.90.0030.0239.52
4.3.80.0030.0379.52
4.3.70.0030.0239.52
4.3.60.0030.0279.52
4.3.50.0070.0239.52
4.3.40.0070.0339.52
4.3.30.0070.0209.52
4.3.20.0000.0309.52
4.3.10.0100.0179.52
4.3.00.0270.03314.57

preferences:
47.02 ms | 401 KiB | 5 Q