3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bijective { public $dictionary = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; public function __construct() { $this->dictionary = str_split($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); } $result = array_reverse($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);

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.70.0090.00618.30
8.3.60.0090.01218.62
8.3.50.0040.01521.97
8.3.40.0120.00319.02
8.3.30.0070.00718.84
8.3.20.0070.00020.35
8.3.10.0060.00320.61
8.3.00.0060.00323.52
8.2.190.0040.01116.90
8.2.180.0140.00316.63
8.2.170.0180.00422.96
8.2.160.0130.00322.16
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00320.87
8.2.120.0000.00826.35
8.2.110.0080.00321.99
8.2.100.0040.00717.93
8.2.90.0030.00519.22
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0000.00817.91
8.2.50.0000.00818.09
8.2.40.0040.00420.58
8.2.30.0040.00419.57
8.2.20.0000.00817.84
8.2.10.0040.00418.18
8.2.00.0000.00718.04
8.1.280.0110.00725.92
8.1.270.0030.00522.14
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0060.00320.86
8.1.230.0120.00017.70
8.1.220.0000.00917.74
8.1.210.0030.00618.77
8.1.200.0040.00417.35
8.1.190.0030.00617.25
8.1.180.0040.00418.10
8.1.170.0000.00818.64
8.1.160.0000.00720.82
8.1.150.0040.00420.59
8.1.140.0000.00819.46
8.1.130.0070.00017.63
8.1.120.0050.00217.52
8.1.110.0030.00517.45
8.1.100.0000.00717.50
8.1.90.0020.00517.48
8.1.80.0000.00717.38
8.1.70.0030.00317.47
8.1.60.0040.00417.59
8.1.50.0040.00417.48
8.1.40.0000.00917.54
8.1.30.0040.00417.60
8.1.20.0000.00817.55
8.1.10.0000.00717.55
8.1.00.0040.00417.41
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0070.00018.34
8.0.270.0000.00717.26
8.0.260.0030.00317.27
8.0.250.0030.00317.02
8.0.240.0000.00617.02
8.0.230.0000.00716.93
8.0.220.0000.00716.98
8.0.210.0040.00416.88
8.0.200.0000.00616.95
8.0.190.0040.00417.01
8.0.180.0040.00416.97
8.0.170.0000.00816.90
8.0.160.0040.00416.90
8.0.150.0080.00016.98
8.0.140.0050.00216.97
8.0.130.0030.00313.37
8.0.120.0040.00416.94
8.0.110.0030.00516.88
8.0.100.0040.00416.91
8.0.90.0040.00416.95
8.0.80.0060.01016.97
8.0.70.0050.00216.80
8.0.60.0070.00016.80
8.0.50.0000.00716.87
8.0.30.0120.00617.27
8.0.20.0090.01117.40
8.0.10.0000.00716.92
8.0.00.0090.00816.78
7.4.330.0030.00316.72
7.4.320.0030.00316.64
7.4.300.0000.00716.46
7.4.290.0030.00616.41
7.4.280.0000.00716.63
7.4.270.0030.00316.61
7.4.260.0060.00316.43
7.4.250.0000.00816.60
7.4.240.0000.00716.43
7.4.230.0040.00416.53
7.4.220.0090.00916.57
7.4.210.0050.00916.64
7.4.200.0000.00716.50
7.4.160.0090.00616.48
7.4.150.0120.00617.40
7.4.140.0070.01017.86
7.4.130.0100.01216.60
7.4.120.0080.00916.54
7.4.110.0100.00916.66
7.4.100.0100.01116.45
7.4.90.0140.00316.67
7.4.80.0080.00819.39
7.4.70.0100.00716.66
7.4.60.0050.01516.64
7.4.50.0060.01216.62
7.4.40.0060.01016.64
7.4.30.0080.00816.71
7.4.00.0030.01214.84
7.3.330.0030.00313.30
7.3.320.0030.00313.50
7.3.310.0040.00416.46
7.3.300.0040.00216.31
7.3.290.0080.00816.43
7.3.280.0080.00716.48
7.3.270.0120.00617.40
7.3.260.0180.00916.58
7.3.250.0090.00916.48
7.3.240.0080.01216.54
7.3.230.0130.00416.67
7.3.210.0070.01116.44
7.3.200.0100.01316.73
7.3.190.0130.00216.56
7.3.180.0110.00616.41
7.3.170.0090.00916.62
7.3.160.0030.01416.54
7.3.120.0090.00914.75
7.3.110.0120.00614.86
7.3.100.0030.01314.84
7.3.90.0120.00314.77
7.3.80.0000.01014.94
7.3.70.0090.00614.39
7.3.60.0070.00714.92
7.3.50.0000.00914.85
7.3.40.0030.00915.07
7.3.30.0100.00014.57
7.3.20.0040.01216.78
7.3.10.0080.01016.51
7.3.00.0130.00616.79
7.2.330.0040.01416.78
7.2.320.0070.01016.41
7.2.310.0070.01516.67
7.2.300.0070.01116.46
7.2.290.0060.00916.70
7.2.250.0070.01315.30
7.2.240.0110.00815.29
7.2.230.0030.01314.95
7.2.220.0090.00614.70
7.2.210.0070.01014.85
7.2.200.0100.01015.01
7.2.190.0050.00514.88
7.2.180.0060.00614.82
7.2.170.0060.00615.21
7.2.130.0080.00316.71
7.2.120.0080.00416.70
7.2.110.0080.00616.59
7.2.100.0070.00916.69
7.2.90.0090.00416.67
7.2.80.0090.00316.77
7.2.70.0070.00716.99
7.2.60.0080.00816.69
7.2.50.0140.00616.76
7.2.40.0070.00916.79
7.2.30.0090.00316.61
7.2.20.0080.00716.67
7.2.10.0100.00616.78
7.2.00.0050.01017.82
7.1.330.0070.00715.93
7.1.320.0030.00715.83
7.1.310.0120.00615.86
7.1.300.0040.00815.66
7.1.290.0060.00615.77
7.1.280.0130.00015.54
7.1.270.0060.00615.52
7.1.260.0040.01115.60
7.1.250.0100.00415.38
7.1.200.0030.00915.61
7.1.100.0120.00818.27
7.1.70.0030.00617.11
7.1.60.0170.00719.40
7.1.50.0070.00717.02
7.1.00.0030.07722.45
7.0.200.0280.00414.63
7.0.60.0230.08321.63
7.0.50.0100.04317.93
7.0.40.0070.04320.36
7.0.30.0200.04720.11
7.0.20.0470.07020.30
7.0.10.0070.04020.06
7.0.00.0070.07020.11
5.6.280.0000.06721.13
5.6.210.0170.07320.66
5.6.200.0000.04318.30
5.6.190.0030.07720.64
5.6.180.0300.07720.67
5.6.170.0100.04720.53
5.6.160.0070.08320.57
5.6.150.0030.04318.19
5.6.140.0000.04018.21
5.6.130.0030.07318.28
5.6.120.0030.04321.01
5.6.110.0030.07020.96
5.6.100.0130.06320.96
5.6.90.0100.05721.13
5.6.80.0130.06720.29
5.5.350.3070.04320.45
5.5.340.0000.08318.01
5.5.330.0170.04320.27
5.5.320.0500.07720.30
5.5.310.0300.07320.37
5.5.300.0100.07317.93
5.5.290.0000.04718.04
5.5.280.0130.08020.96
5.5.270.0100.06720.87
5.5.260.0030.05320.86
5.5.250.0070.08020.50
5.5.240.0270.07720.16

preferences:
67.67 ms | 401 KiB | 5 Q