3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bijective { public $dictionary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; public function __construct() { $this->dictionary = str_split($this->dictionary); var_dump($this->dictionary); } public function encode($i) { if ($i == 0) return $this->dictionary[0]; $result = ''; $base = count($this->dictionary); while ($i > 0) { $result[] = $this->dictionary[($i % $base)]; $i = floor($i / $base); } var_dump($result); $result = array_reverse($result); var_dump($result); return join("", $result); } public function decode($input) { $i = 0; $base = count($this->dictionary); $input = str_split($input); foreach($input as $char) { $pos = array_search($char, $this->dictionary); $i = $i * $base + $pos; } return $i; } } $bj = new Bijective(); $hash = $bj->encode($bj->decode('Abc') + 1); var_dump($hash);

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.0140.00318.18
8.3.50.0170.00018.05
8.3.40.0070.00718.84
8.3.30.0060.00918.66
8.3.20.0080.00020.11
8.3.10.0080.00020.48
8.3.00.0080.00023.43
8.2.180.0130.00316.75
8.2.170.0150.00022.96
8.2.160.0120.00322.16
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0000.00820.93
8.2.120.0080.00026.35
8.2.110.0110.01420.98
8.2.100.0000.01218.03
8.2.90.0030.00518.09
8.2.80.0080.00418.34
8.2.70.0000.00917.75
8.2.60.0000.00818.00
8.2.50.0040.00418.09
8.2.40.0080.00020.51
8.2.30.0050.00319.58
8.2.20.0040.00417.94
8.2.10.0070.00018.13
8.2.00.0040.00418.13
8.1.280.0090.00625.92
8.1.270.0120.00922.14
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0030.00723.96
8.1.230.0070.00420.82
8.1.220.0060.00317.79
8.1.210.0050.00318.85
8.1.200.0070.00417.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0050.00318.66
8.1.160.0070.00020.70
8.1.150.0060.00318.90
8.1.140.0040.00419.66
8.1.130.0000.00717.59
8.1.120.0080.00017.52
8.1.110.0030.00517.45
8.1.100.0040.00417.48
8.1.90.0060.00317.51
8.1.80.0030.00517.44
8.1.70.0000.00717.44
8.1.60.0000.00817.50
8.1.50.0060.00317.55
8.1.40.0000.00817.50
8.1.30.0040.00417.61
8.1.20.0080.00017.44
8.1.10.0000.00917.60
8.1.00.0030.00617.41
8.0.300.0070.00019.92
8.0.290.0040.00416.88
8.0.280.0070.00018.46
8.0.270.0000.00717.32
8.0.260.0000.00717.33
8.0.250.0030.00317.09
8.0.240.0030.00316.93
8.0.230.0040.00417.01
8.0.220.0040.00417.02
8.0.210.0070.00317.06
8.0.200.0030.00317.02
8.0.190.0040.00416.88
8.0.180.0000.00716.96
8.0.170.0050.00316.91
8.0.160.0000.00716.96
8.0.150.0000.00816.80
8.0.140.0030.00516.80
8.0.130.0000.00613.40
8.0.120.0040.00416.84
8.0.110.0000.00716.93
8.0.100.0000.00717.02
8.0.90.0040.00416.84
8.0.80.0190.00316.96
8.0.70.0040.00416.88
8.0.60.0040.00416.86
8.0.50.0030.00517.10
8.0.30.0100.01117.10
8.0.20.0130.01017.40
8.0.10.0040.00417.16
8.0.00.0150.00616.85
7.4.330.0030.00316.67
7.4.320.0050.00316.43
7.4.300.0000.00616.66
7.4.290.0030.00516.58
7.4.280.0040.00416.52
7.4.270.0030.00516.48
7.4.260.0020.00516.37
7.4.250.0000.00816.63
7.4.240.0000.00816.61
7.4.230.0000.00816.51
7.4.220.0060.01416.66
7.4.210.0100.00716.57
7.4.200.0040.00416.70
7.4.160.0150.00316.68
7.4.150.0180.00317.40
7.4.140.0140.00917.86
7.4.130.0150.00916.57
7.4.120.0060.01316.54
7.4.110.0130.01016.61
7.4.100.0150.00716.57
7.4.90.0150.00416.79
7.4.80.0030.01619.39
7.4.70.0150.00216.66
7.4.60.0110.01016.57
7.4.50.0040.01516.41
7.4.40.0150.00316.52
7.4.30.0170.00616.46
7.4.00.0060.00615.00
7.3.330.0030.00313.50
7.3.320.0000.00613.49
7.3.310.0030.00316.41
7.3.300.0020.00516.39
7.3.290.0030.00316.46
7.3.280.0110.00916.42
7.3.270.0070.01317.40
7.3.260.0120.00716.43
7.3.250.0170.00916.55
7.3.240.0160.00916.54
7.3.230.0170.00716.39
7.3.210.0180.00316.44
7.3.200.0030.01616.48
7.3.190.0100.01016.46
7.3.180.0060.01616.50
7.3.170.0130.00716.37
7.3.160.0070.01116.48
7.2.330.0170.00616.62
7.2.320.0060.01216.72
7.2.310.0040.02116.75
7.2.300.0120.00616.66
7.2.290.0090.00916.83
7.2.60.0000.01616.95
7.2.00.0040.01419.32
7.1.200.0000.01315.65
7.1.100.0040.00817.95
7.1.70.0050.00316.82
7.1.60.0130.01319.40
7.1.50.0120.00916.89
7.1.00.0030.07722.36
7.0.200.0110.01114.66
7.0.60.0270.06021.77
7.0.50.0100.06317.88
7.0.40.0070.07320.13
7.0.30.0300.08320.13
7.0.20.0270.08020.22
7.0.10.0000.04720.09
7.0.00.0070.04720.12
5.6.280.0000.03720.91
5.6.210.0030.08020.67
5.6.200.0030.04318.14
5.6.190.0030.06320.61
5.6.180.0330.05720.77
5.6.170.0270.05720.45
5.6.160.0100.08720.46
5.6.150.0100.07718.19
5.6.140.0030.04018.23
5.6.130.0070.05018.29
5.6.120.0070.08021.04
5.6.110.0070.08320.90
5.6.100.0100.08021.01
5.6.90.0200.06321.00
5.6.80.0170.06720.45
5.5.350.0070.03020.37
5.5.340.0030.07317.97
5.5.330.0170.07320.41
5.5.320.0470.04020.31
5.5.310.0230.08720.24
5.5.300.0070.03717.94
5.5.290.0100.07718.05
5.5.280.0070.08320.80
5.5.270.0130.07720.87
5.5.260.0070.07720.73
5.5.250.0100.07320.59
5.5.240.0130.03320.29

preferences:
50.87 ms | 401 KiB | 5 Q