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; } } } 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.00916.48
8.3.50.0140.00717.87
8.3.40.0120.00318.79
8.3.30.0110.00419.07
8.3.20.0040.00420.29
8.3.10.0030.00621.78
8.3.00.0000.00820.71
8.2.180.0180.00317.98
8.2.170.0040.01122.96
8.2.160.0140.00722.17
8.2.150.0070.00724.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0080.00019.78
8.2.110.0090.00020.53
8.2.100.0000.01318.22
8.2.90.0030.00519.22
8.2.80.0030.00617.97
8.2.70.0080.00417.63
8.2.60.0110.00018.05
8.2.50.0060.00618.07
8.2.40.0090.00020.07
8.2.30.0040.00418.03
8.2.20.0000.00817.81
8.2.10.0040.00418.19
8.2.00.0030.00517.82
8.1.280.0070.01125.92
8.1.270.0080.00020.64
8.1.260.0050.00326.35
8.1.250.0070.00328.09
8.1.240.0040.00423.96
8.1.230.0090.00319.05
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0040.00421.95
8.1.150.0110.00018.96
8.1.140.0000.00819.23
8.1.130.0030.00317.84
8.1.120.0030.00417.46
8.1.110.0000.00817.34
8.1.100.0030.00417.46
8.1.90.0000.00717.38
8.1.80.0000.00717.46
8.1.70.0030.00317.50
8.1.60.0000.00917.57
8.1.50.0050.00317.54
8.1.40.0000.00817.59
8.1.30.0000.00817.66
8.1.20.0060.00317.72
8.1.10.0050.00217.46
8.1.00.0090.00317.41
8.0.300.0080.00018.77
8.0.290.0000.00716.58
8.0.280.0030.00318.43
8.0.270.0040.00417.30
8.0.260.0030.00717.34
8.0.250.0000.00716.94
8.0.240.0040.00417.05
8.0.230.0030.00317.02
8.0.220.0030.00316.97
8.0.210.0000.00616.77
8.0.200.0030.00316.95
8.0.190.0040.00416.96
8.0.180.0040.00416.84
8.0.170.0030.00516.86
8.0.160.0050.00216.95
8.0.150.0050.00216.95
8.0.140.0000.00816.80
8.0.130.0030.00313.29
8.0.120.0000.00816.86
8.0.110.0040.00416.84
8.0.100.0040.00416.79
8.0.90.0000.00716.91
8.0.80.0130.00316.89
8.0.70.0030.00516.98
8.0.60.0000.00716.83
8.0.50.0040.00416.83
8.0.30.0170.00817.10
8.0.20.0140.01317.40
8.0.10.0070.00016.88
8.0.00.0030.01516.96
7.4.330.0000.00615.03
7.4.320.0030.00316.53
7.4.300.0000.00716.51
7.4.290.0050.00316.44
7.4.280.0030.00516.45
7.4.270.0040.00416.63
7.4.260.0000.00916.52
7.4.250.0070.00016.61
7.4.240.0040.00416.67
7.4.230.0030.00316.64
7.4.220.0200.00716.61
7.4.210.0090.01216.68
7.4.200.0080.00016.44
7.4.160.0080.00816.36
7.4.150.0100.01017.40
7.4.140.0110.00617.86
7.4.130.0140.00516.56
7.4.120.0090.01116.49
7.4.110.0050.01316.66
7.4.100.0120.01216.45
7.4.90.0100.00616.55
7.4.80.0160.00319.39
7.4.70.0130.00916.39
7.4.60.0000.01716.47
7.4.50.0030.00616.74
7.4.40.0120.00916.50
7.4.30.0100.00716.57
7.4.00.0080.00615.03
7.3.330.0030.00413.46
7.3.320.0060.00613.37
7.3.310.0000.00716.29
7.3.300.0030.00316.20
7.3.290.0060.01016.39
7.3.280.0100.01016.40
7.3.270.0180.00317.40
7.3.260.0100.00916.43
7.3.250.0040.01316.53
7.3.240.0060.01016.68
7.3.230.0120.01216.41
7.3.210.0070.01016.45
7.3.200.0170.00319.39
7.3.190.0080.00816.43
7.3.180.0080.00816.40
7.3.170.0100.01016.57
7.3.160.0060.00916.44
7.3.10.0030.00916.55
7.3.00.0060.00616.59
7.2.330.0070.01416.76
7.2.320.0060.01216.61
7.2.310.0090.00916.82
7.2.300.0120.00616.75
7.2.290.0090.01216.71
7.2.130.0110.00516.89
7.2.120.0050.01016.85
7.2.110.0090.00417.05
7.2.100.0050.01017.02
7.2.90.0070.00816.95
7.2.80.0080.00817.04
7.2.70.0060.00816.89
7.2.60.0100.00417.00
7.2.50.0020.01516.80
7.2.40.0070.00717.01
7.2.30.0100.00516.83
7.2.20.0020.01216.93
7.2.10.0110.00516.96
7.2.00.0070.00717.77
7.1.250.0130.00315.71
7.1.240.0090.00315.54
7.1.230.0100.00315.83
7.1.220.0030.00515.77
7.1.210.0110.00415.79
7.1.200.0060.00915.79
7.1.190.0040.01115.88
7.1.180.0090.00616.04
7.1.170.0080.00515.79
7.1.160.0030.01015.64
7.1.150.0000.01115.92
7.1.140.0060.00615.98
7.1.130.0070.00715.71
7.1.120.0070.00415.83
7.1.110.0030.01015.57
7.1.100.0040.00617.03
7.1.90.0030.01215.96
7.1.80.0100.00715.63
7.1.70.0020.01316.56
7.1.60.0080.00817.61
7.1.50.0060.01016.41
7.1.40.0000.01415.82
7.1.30.0040.01115.96
7.1.20.0070.00715.81
7.1.10.0040.01115.69
7.1.00.0060.04019.03
7.0.330.0040.01215.42
7.0.320.0030.00715.34
7.0.310.0070.00715.23
7.0.300.0040.01115.54
7.0.290.0000.00915.46
7.0.280.0110.01115.47
7.0.270.0040.00415.56
7.0.260.0030.01515.27
7.0.250.0040.00715.32
7.0.240.0050.00315.46
7.0.230.0040.01115.41
7.0.220.0040.01115.19
7.0.210.0040.01215.10
7.0.200.0100.00316.02
7.0.190.0060.00315.61
7.0.180.0090.00315.60
7.0.170.0030.00615.56
7.0.160.0030.00515.29
7.0.150.0040.00715.46
7.0.140.0080.03618.64
7.0.130.0040.00815.66
7.0.120.0040.00715.55
7.0.110.0040.00815.38
7.0.100.0040.00815.16
7.0.90.0030.01215.35
7.0.80.0080.00815.59
7.0.70.0000.01115.43
7.0.60.0100.04217.76
7.0.50.0030.03816.74
7.0.40.0100.02516.88
7.0.30.0180.03916.93
7.0.20.0160.04316.94
7.0.10.0030.03016.85
7.0.00.0070.02516.86
5.6.380.0070.00714.57
5.6.370.0060.00914.14
5.6.360.0070.01014.65
5.6.350.0070.00714.43
5.6.340.0030.00914.04
5.6.330.0030.01314.46
5.6.320.0070.00714.14
5.6.310.0030.01014.55
5.6.300.0050.00314.44
5.6.290.0030.00614.69
5.6.280.0020.04317.77
5.6.270.0080.00014.30
5.6.260.0070.00714.54
5.6.250.0050.00214.49
5.6.240.0040.00414.65
5.6.230.0060.00914.29
5.6.220.0060.00314.65
5.6.210.0020.03217.57
5.6.200.0040.03116.19
5.6.190.0110.02217.57
5.6.180.0330.03317.31
5.6.170.0190.04017.54
5.6.160.0150.03917.38
5.6.150.0070.02416.18
5.6.140.0030.03016.29
5.6.130.0100.03716.26
5.6.120.0080.04317.71
5.6.110.0010.02517.62
5.6.100.0140.02317.66
5.6.90.0100.04117.84
5.6.80.0100.04517.33
5.6.70.0030.00714.48
5.6.60.0140.00014.27
5.6.50.0090.00614.29
5.6.40.0090.00614.26
5.6.30.0150.00314.17
5.6.20.0070.00714.36
5.6.10.0030.01014.21
5.6.00.0060.00914.29
5.5.380.0000.01011.18
5.5.370.0060.00311.30
5.5.360.0030.00711.18
5.5.350.0240.03715.78
5.5.340.0080.02614.67
5.5.330.0050.04115.97
5.5.320.0030.04415.79
5.5.310.0110.02915.90
5.5.300.0030.02714.59
5.5.290.0080.02214.71
5.5.280.0020.02616.17
5.5.270.0080.02216.06
5.5.260.0070.02316.08
5.5.250.0030.02815.94
5.5.240.0000.01915.74
5.5.230.0040.00411.21
5.5.220.0080.00011.34
5.5.210.0040.00411.27
5.5.200.0030.00311.20
5.5.190.0060.00311.27
5.5.180.0070.00311.30
5.5.170.0060.00011.32
5.5.160.0070.00011.18
5.5.150.0030.00311.34
5.5.140.0100.00011.18
5.5.130.0030.00611.48
5.5.120.0130.00011.40
5.5.110.0030.00311.32
5.5.100.0140.00011.18
5.5.90.0060.00311.18
5.5.80.0060.00611.18
5.5.70.0060.00611.27
5.5.60.0130.00311.33
5.5.50.0000.00611.30
5.5.40.0040.00711.18
5.5.30.0060.00611.18
5.5.20.0040.00411.18
5.5.10.0000.00711.18
5.5.00.0040.00711.18
5.4.450.0080.04415.35
5.4.440.0150.03815.45
5.4.430.0160.03815.32
5.4.420.0090.02615.33
5.4.410.0080.02415.12
5.4.400.0120.02115.13
5.4.390.0070.02415.01
5.4.380.0150.01515.02
5.4.370.0080.02315.15
5.4.360.0120.02415.18
5.4.350.0070.02715.25
5.4.340.0080.02115.13
5.4.330.0000.00811.18
5.4.320.0120.01815.02
5.4.310.0050.02515.29
5.4.300.0100.02215.13
5.4.290.0060.02315.06
5.4.280.0080.02215.24
5.4.270.0100.02215.01
5.4.260.0100.02215.11
5.4.250.0210.02215.07
5.4.240.0100.02115.17
5.4.230.0100.02015.16
5.4.220.0190.03215.18
5.4.210.0180.03315.01
5.4.200.0150.02515.01
5.4.190.0140.03515.20
5.4.180.0180.03215.13
5.4.170.0120.02715.05
5.4.160.0110.02515.11
5.4.150.0140.03915.23
5.4.140.0130.02513.78
5.4.130.0190.03513.84
5.4.120.0150.02713.87
5.4.110.0160.03613.87
5.4.100.0150.03313.81
5.4.90.0160.02614.02
5.4.80.0130.04113.84
5.4.70.0140.03713.74
5.4.60.0130.02313.80
5.4.50.0170.03513.88
5.4.40.0130.02913.86
5.4.30.0110.03513.85
5.4.20.0180.02813.83
5.4.10.0160.03313.85
5.4.00.0150.03713.54
5.3.290.0080.02212.88
5.3.280.0200.03212.93
5.3.270.0110.02812.89
5.3.260.0200.02712.94
5.3.250.0120.02312.85
5.3.240.0150.03712.85
5.3.230.0100.04312.93
5.3.220.0130.04012.98
5.3.210.0150.02412.93
5.3.200.0140.03612.88
5.3.190.0150.03812.92
5.3.180.0170.03412.88
5.3.170.0220.03212.82
5.3.160.0180.03112.88
5.3.150.0170.02512.92
5.3.140.0100.02712.82
5.3.130.0120.02712.92
5.3.120.0180.02512.87
5.3.110.0130.04012.80
5.3.100.0150.04112.57
5.3.90.0150.02312.61
5.3.80.0160.03412.56
5.3.70.0130.02812.65
5.3.60.0140.03012.54
5.3.50.0080.03512.52
5.3.40.0160.02612.61
5.3.30.0140.03112.50
5.3.20.0130.03712.52
5.3.10.0150.02312.37
5.3.00.0280.03112.40
5.2.170.0100.02411.61
5.2.160.0120.02811.61
5.2.150.0120.03311.61
5.2.140.0110.02411.61
5.2.130.0130.02511.61
5.2.120.0100.02811.61
5.2.110.0070.03211.61
5.2.100.0110.03011.61
5.2.90.0100.03311.61
5.2.80.0150.01711.61
5.2.70.0070.02811.61
5.2.60.0130.01911.61
5.2.50.0150.03311.61
5.2.40.0120.02711.61
5.2.30.0090.02711.61
5.2.20.0100.02511.61
5.2.10.0120.02911.61
5.2.00.0130.03011.61
5.1.60.0140.01811.61
5.1.50.0130.02311.61
5.1.40.0100.02611.61
5.1.30.0120.02911.61
5.1.20.0100.02411.61
5.1.10.0100.02911.61
5.1.00.0100.02711.61
5.0.50.0050.02511.61
5.0.40.0030.01811.61
5.0.30.0090.02511.61
5.0.20.0070.01311.61
5.0.10.0030.01611.61
5.0.00.0030.03711.61
4.4.90.0030.01411.61
4.4.80.0080.00811.61
4.4.70.0070.01711.61
4.4.60.0050.02111.61
4.4.50.0070.01911.61
4.4.40.0080.02211.61
4.4.30.0070.01811.61
4.4.20.0070.01211.61
4.4.10.0080.01811.61
4.4.00.0030.02911.61
4.3.110.0120.01311.61
4.3.100.0060.00911.61
4.3.90.0050.01011.61
4.3.80.0080.02311.61
4.3.70.0070.01511.61
4.3.60.0070.01211.61
4.3.50.0070.01711.61
4.3.40.0050.02311.61
4.3.30.0030.01811.61
4.3.20.0030.01511.61
4.3.10.0060.01111.61
4.3.00.0030.02111.61

preferences:
64.91 ms | 400 KiB | 5 Q