3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('ALPHABET', 'acdegilmnoprstuw'); $hash = 680131659347; $string = 'leepadg'; 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)) ; 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; } } echo $result; 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.0120.00616.63
8.3.50.0100.01018.09
8.3.40.0090.00618.98
8.3.30.0110.00419.25
8.3.20.0040.00420.33
8.3.10.0040.00421.91
8.3.00.0040.00420.94
8.2.180.0040.01516.63
8.2.170.0140.00022.96
8.2.160.0140.00021.95
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.90
8.2.110.0040.00420.47
8.2.100.0060.00618.28
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0030.00618.04
8.2.50.0030.00618.07
8.2.40.0000.00819.77
8.2.30.0000.00718.20
8.2.20.0080.00017.68
8.2.10.0080.00018.04
8.2.00.0040.00417.70
8.1.280.0140.00725.92
8.1.270.0040.00420.77
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00623.88
8.1.230.0100.00019.03
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0030.00617.13
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0040.00418.48
8.1.160.0000.00722.02
8.1.150.0060.00318.85
8.1.140.0080.00019.15
8.1.130.0000.00817.82
8.1.120.0040.00417.48
8.1.110.0040.00417.47
8.1.100.0070.00017.43
8.1.90.0030.00417.32
8.1.80.0040.00417.39
8.1.70.0040.00417.48
8.1.60.0030.00617.65
8.1.50.0060.00317.38
8.1.40.0040.00417.46
8.1.30.0000.00817.58
8.1.20.0040.00417.64
8.1.10.0050.00317.42
8.1.00.0000.01017.54
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.44
8.0.270.0000.00717.25
8.0.260.0090.00017.19
8.0.250.0000.00616.96
8.0.240.0030.00316.98
8.0.230.0030.00316.95
8.0.220.0030.00316.93
8.0.210.0000.00716.91
8.0.200.0070.00016.88
8.0.190.0030.00616.96
8.0.180.0050.00316.92
8.0.170.0000.00716.83
8.0.160.0070.00016.91
8.0.150.0000.00716.76
8.0.140.0070.00016.93
8.0.130.0000.00613.26
8.0.120.0050.00316.79
8.0.110.0080.00016.90
8.0.100.0070.00016.81
8.0.90.0040.00416.73
8.0.80.0090.00616.88
8.0.70.0070.00016.97
8.0.60.0000.00816.78
8.0.50.0040.00416.71
8.0.30.0070.01717.27
8.0.20.0230.02517.40
8.0.10.0000.00716.98
8.0.00.0020.01616.61
7.4.330.0030.00315.03
7.4.320.0000.00716.54
7.4.300.0000.00616.53
7.4.290.0070.00016.63
7.4.280.0000.00816.61
7.4.270.0040.00416.53
7.4.260.0000.00716.45
7.4.250.0040.00416.38
7.4.240.0060.00116.64
7.4.230.0040.00416.71
7.4.220.0070.01316.50
7.4.210.0090.00616.53
7.4.200.0000.00816.38
7.4.160.0060.01016.36
7.4.150.0170.00917.40
7.4.140.0090.00917.86
7.4.130.0100.00716.56
7.4.120.0100.00716.46
7.4.110.0130.01016.57
7.4.100.0060.01716.45
7.4.90.0090.00916.49
7.4.80.0180.00719.39
7.4.70.0070.01616.59
7.4.60.0000.01516.54
7.4.50.0040.00416.73
7.4.40.0090.00916.57
7.4.30.0080.01016.61
7.4.00.0070.01015.15
7.3.330.0030.00313.15
7.3.320.0060.00613.40
7.3.310.0060.00016.43
7.3.300.0000.00716.27
7.3.290.0060.01116.38
7.3.280.0080.01116.40
7.3.270.0150.00917.40
7.3.260.0160.00416.50
7.3.250.0080.01016.39
7.3.240.0100.00716.37
7.3.230.0070.01016.41
7.3.210.0070.01016.63
7.3.200.0150.00519.39
7.3.190.0130.00316.53
7.3.180.0100.00716.46
7.3.170.0150.00916.68
7.3.160.0070.01016.36
7.2.330.0100.00716.44
7.2.320.0100.00716.89
7.2.310.0090.00916.69
7.2.300.0090.01316.70
7.2.290.0130.01016.95
7.1.100.0000.01218.04
7.1.70.0000.01017.06
7.1.60.0080.01217.30
7.1.50.0100.01016.92
7.1.40.0040.00716.67
7.1.30.0080.00816.68
7.1.20.0100.00516.75
7.1.10.0080.00816.59
7.1.00.0000.01016.61
7.0.200.0040.01116.68
7.0.190.0060.01016.68
7.0.180.0070.00516.27
7.0.170.0000.01116.51
7.0.160.0070.00716.29
7.0.150.0030.01016.13
7.0.140.0120.00316.31
7.0.130.0080.00016.72
7.0.120.0030.00616.68
7.0.110.0000.01716.23
7.0.100.0040.00416.19
7.0.90.0000.00916.32
7.0.80.0080.00016.38
7.0.70.0000.00816.27
7.0.60.0000.00716.16
7.0.50.0060.00616.50
7.0.40.0070.00715.17
7.0.30.0030.01315.17
7.0.20.0030.01315.17
7.0.10.0030.01015.17
7.0.00.0000.00815.17
5.6.300.0140.05320.63
5.6.290.0140.04620.80
5.6.280.0000.04520.98
5.6.270.0100.03421.08
5.6.260.0090.03421.09
5.6.250.0060.04920.79
5.6.240.0100.04821.02
5.6.230.0000.04920.96
5.6.220.0030.04121.01
5.6.210.0000.05321.04
5.6.200.0000.06320.80
5.6.190.0000.04921.01
5.6.180.0030.05220.96
5.6.170.0100.07120.79
5.6.160.0030.08321.04
5.6.150.0030.06820.71
5.6.140.0000.07621.00
5.6.130.0030.04020.78
5.6.120.0070.04020.97
5.6.110.0100.07220.95
5.6.100.0070.04121.02
5.6.90.0130.04420.81
5.6.80.0060.03920.18
5.6.70.0070.06220.20
5.6.60.0030.07420.18
5.6.50.0100.06620.20
5.6.40.0030.04320.18
5.6.30.0030.04320.19
5.6.20.0000.06920.24
5.6.10.0070.06720.11
5.6.00.0070.07520.16
5.5.380.0030.03817.44
5.5.370.0030.04017.62
5.5.360.0030.06917.57
5.5.350.0070.07517.41
5.5.340.0070.04018.10
5.5.330.0030.04317.96
5.5.320.0030.04517.73
5.5.310.0000.04217.86
5.5.300.0100.05718.06
5.5.290.0030.04218.06
5.5.280.0030.04717.95
5.5.270.0060.08417.67
5.5.260.0000.06617.85
5.5.250.0030.04017.82
5.5.240.0070.05817.24
5.5.230.0000.05317.46
5.5.220.0000.05517.47
5.5.210.0000.05917.46
5.5.200.0000.04217.45
5.5.190.0030.07117.23
5.5.180.0030.04217.21
5.5.160.0070.07217.44
5.5.150.0000.05017.45
5.5.140.0030.03717.49
5.5.130.0000.05017.44
5.5.120.0070.03717.45
5.5.110.0100.06017.20
5.5.100.0060.04817.24
5.5.90.0070.04317.11
5.5.80.0030.03817.33
5.5.70.0030.06017.25
5.5.60.0030.07817.33
5.5.50.0060.03517.34
5.5.40.0000.05717.24
5.5.30.0030.03717.31
5.5.20.0000.04217.24
5.5.10.0030.03917.23
5.5.00.0030.03817.18
5.4.450.0000.04419.45
5.4.440.0030.04219.36
5.4.430.0070.07519.46
5.4.420.0000.04419.26
5.4.410.0100.03319.14
5.4.400.0070.05418.91
5.4.390.0000.04118.91
5.4.380.0070.06219.08
5.4.370.0030.03918.88
5.4.360.0000.04319.14
5.4.350.0070.07418.90
5.4.340.0000.04119.04
5.4.320.0070.07519.21
5.4.310.0070.04619.02
5.4.300.0030.03819.08
5.4.290.0100.03218.90
5.4.280.0000.04119.11
5.4.270.0000.04419.08
5.4.260.0060.03419.15
5.4.250.0000.04118.94
5.4.240.0030.03718.89
5.4.230.0070.07319.11
5.4.220.0070.05718.94
5.4.210.0030.06918.98
5.4.200.0000.04418.95
5.4.190.0000.04519.04
5.4.180.0000.06119.11
5.4.170.0000.04319.07
5.4.160.0060.03619.20
5.4.150.0070.06019.20
5.4.140.0100.06816.82
5.4.130.0060.03216.54
5.4.120.0000.05416.81
5.4.110.0070.03416.71
5.4.100.0060.03116.75
5.4.90.0030.06916.75
5.4.80.0030.04016.66
5.4.70.0070.04116.64
5.4.60.0000.04116.46
5.4.50.0000.03916.86
5.4.40.0000.03916.55
5.4.30.0030.03616.45
5.4.20.0060.03516.44
5.4.10.0000.04316.71
5.4.00.0070.04716.09
5.3.290.0030.07915.17
5.3.280.0070.07215.17
5.3.270.0100.04915.17
5.3.260.0100.07015.17
5.3.250.0000.04115.17
5.3.240.0030.04815.17
5.3.230.0000.08415.17
5.3.220.0030.07515.17
5.3.210.0000.04015.17
5.3.200.0100.03715.17
5.3.190.0100.07615.17
5.3.180.0030.05515.17
5.3.170.0070.07615.17
5.3.160.0040.03915.17
5.3.150.0030.03615.17
5.3.140.0000.03815.17
5.3.130.0030.04115.17
5.3.120.0090.03215.17
5.3.110.0000.04015.17
5.3.100.0030.07315.17
5.3.90.0000.04215.17
5.3.80.0000.07315.17
5.3.70.0070.05715.17
5.3.60.0160.03615.17
5.3.50.0070.05015.17
5.3.40.0000.04115.17
5.3.30.0040.04215.17
5.3.20.0030.03615.17
5.3.10.0030.03315.17
5.3.00.0030.03815.17
5.2.170.0000.03415.17
5.2.160.0000.03015.17
5.2.150.0070.06215.17
5.2.140.0000.04515.17
5.2.130.0070.02415.17
5.2.120.0000.03115.17
5.2.110.0000.03015.17
5.2.100.0030.03015.17
5.2.90.0030.03015.17
5.2.80.0030.03015.17
5.2.70.0000.03215.17
5.2.60.0030.02915.17
5.2.50.0030.02815.17
5.2.40.0030.02715.17
5.2.30.0030.03215.17
5.2.20.0070.02715.17
5.2.10.0030.02915.17
5.2.00.0070.02615.17
5.1.60.0000.02715.17
5.1.50.0000.02615.17
5.1.40.0070.03715.17
5.1.30.0030.02915.17
5.1.20.0030.02415.17
5.1.10.0140.02815.17
5.1.00.0030.02915.17
5.0.50.0030.04915.17
5.0.40.0040.02215.17
5.0.30.0000.03415.17
5.0.20.0030.01815.17
5.0.10.0000.02215.17
5.0.00.0000.03315.17
4.4.90.0000.02115.17
4.4.80.0000.02315.17
4.4.70.0000.01815.17
4.4.60.0030.02515.17
4.4.50.0000.01815.17
4.4.40.0060.01915.17
4.4.30.0030.01515.17
4.4.20.0070.02015.17
4.4.10.0000.01715.17
4.4.00.0030.02415.17
4.3.110.0100.01715.17
4.3.100.0030.01515.17
4.3.90.0000.01815.17
4.3.80.0030.04915.17
4.3.70.0000.02615.17
4.3.60.0060.01315.17
4.3.50.0000.01715.17
4.3.40.0070.02315.17
4.3.30.0000.02215.17
4.3.20.0000.02415.17
4.3.10.0000.02315.17
4.3.00.0000.01915.17

preferences:
50.25 ms | 400 KiB | 5 Q