3v4l.org

run code in 300+ PHP versions simultaneously
<?php class base58 { static public $alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; public static function encode($int) { $base58_string = ""; $base = strlen(self::$alphabet); while($int >= $base) { $div = floor($int / $base); $mod = ($int - ($base * $div)); // php's % is broke with >32bit int on 32bit proc $base58_string = self::$alphabet{$mod} . $base58_string; $int = $div; } if($int) $base58_string = self::$alphabet{$int} . $base58_string; return $base58_string; } public static function decode($base58) { $int_val = 0; for($i=strlen($base58)-1,$j=1,$base=strlen(self::$alphabet);$i>=0;$i--,$j*=$base) { $int_val += $j * strpos(self::$alphabet, $base58{$i}); } return $int_val; } } for($i = 0; $i < 1000; $i++) { echo "http://flic.kr/p/" . base58::encode('3392387861') . "\n"; }

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.40.0060.01218.56
8.3.30.0070.00718.96
8.3.20.0000.00820.21
8.3.10.0040.00423.61
8.3.00.0030.00520.77
8.2.170.0070.01022.96
8.2.160.0100.00320.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.81
8.2.110.0040.00721.18
8.2.100.0110.00018.09
8.2.90.0080.00019.13
8.2.80.0080.00017.97
8.2.70.0030.00617.50
8.2.60.0040.00417.68
8.2.50.0000.00918.10
8.2.40.0000.00719.46
8.2.30.0040.00418.18
8.2.20.0040.00717.44
8.2.10.0040.00417.83
8.2.00.0000.00717.62
8.1.270.0040.00423.88
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0050.00521.24
8.1.230.0040.00717.70
8.1.220.0070.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.00
8.1.190.0080.00017.11
8.1.180.0000.00718.10
8.1.170.0000.00818.54
8.1.160.0000.00721.95
8.1.150.0060.00318.43
8.1.140.0000.00917.20
8.1.130.0000.00717.82
8.1.120.0070.00017.40
8.1.110.0040.00417.23
8.1.100.0000.00717.24
8.1.90.0040.00417.30
8.1.80.0070.00017.27
8.1.70.0070.00017.29
8.1.60.0000.00817.46
8.1.50.0040.00417.38
8.1.40.0030.00617.31
8.1.30.0040.00417.50
8.1.20.0060.00317.42
8.1.10.0000.00817.29
8.1.00.0040.00417.31
8.0.300.0070.00018.77
8.0.290.0080.00016.63
8.0.280.0030.00318.23
8.0.270.0000.00717.13
8.0.260.0000.00617.07
8.0.250.0040.00416.81
8.0.240.0040.00416.83
8.0.230.0040.00416.91
8.0.220.0030.00316.81
8.0.210.0040.00416.82
8.0.200.0040.00416.78
8.0.190.0050.00316.84
8.0.180.0040.00416.82
8.0.170.0080.00016.89
8.0.160.0040.00416.86
8.0.150.0000.00716.78
8.0.140.0000.00816.62
8.0.130.0080.00013.14
8.0.120.0030.00616.78
8.0.110.0050.00216.72
8.0.100.0040.00416.79
8.0.90.0030.00516.84
8.0.80.0060.00916.80
8.0.70.0050.00216.86
8.0.60.0050.00216.63
8.0.50.0000.00716.71
8.0.30.0050.01516.86
8.0.20.0190.00317.40
8.0.10.0070.00016.83
8.0.00.0040.01716.51
7.4.330.0040.00415.26
7.4.320.0000.00616.41
7.4.300.0000.00816.53
7.4.290.0050.00316.50
7.4.280.0080.00316.45
7.4.270.0000.00916.55
7.4.260.0050.00316.51
7.4.250.0060.00316.47
7.4.240.0040.00416.48
7.4.230.0060.00316.57
7.4.220.0160.01616.41
7.4.210.0100.00716.58
7.4.200.0070.00016.37
7.4.190.0040.00416.69
7.4.160.0100.01016.53
7.4.150.0030.02417.40
7.4.140.0310.01117.86
7.4.130.0260.00416.59
7.4.120.0210.01716.52
7.4.110.0370.03816.43
7.4.100.0140.00716.48
7.4.90.0340.02416.71
7.4.80.0110.01119.39
7.4.70.0110.01116.64
7.4.60.0210.01716.51
7.4.50.0060.00316.45
7.4.40.0170.02116.54
7.4.30.0030.02016.57
7.3.330.0040.00413.47
7.3.320.0040.00413.34
7.3.310.0030.00516.40
7.3.300.0100.00016.35
7.3.290.0090.00916.57
7.3.280.0120.01016.41
7.3.270.0070.01417.40
7.3.260.0060.02216.53
7.3.250.0300.01316.48
7.3.240.0140.00716.53
7.3.230.0170.00816.39
7.3.210.0510.00916.56
7.3.200.0150.02119.39
7.3.190.0350.02316.43
7.3.180.0210.01516.55
7.3.170.0640.01616.50
7.3.160.0100.01016.39
7.2.330.0080.01616.59
7.2.320.0160.00616.48
7.2.310.0120.01216.64
7.2.300.0120.00616.88
7.2.290.0660.02016.88
7.1.30.0730.06736.49
7.1.20.0830.08036.47
7.1.10.0700.06720.41
7.1.00.0600.06521.38
7.0.170.0770.05720.07
7.0.160.0830.06720.10
7.0.150.1030.06320.06
7.0.140.0370.06521.05
7.0.130.1000.05720.18
7.0.120.0670.07020.22
7.0.110.0770.05720.10
7.0.100.1650.06520.02
7.0.90.0500.07020.04
7.0.80.0680.07819.98
7.0.70.0520.06720.00
7.0.60.0580.05020.08
7.0.50.0350.05520.21
7.0.40.0580.06020.04
7.0.30.0520.06820.06
7.0.20.0530.07720.10
7.0.10.0430.07220.13
7.0.00.0570.07320.00
5.6.300.0200.04720.62
5.6.290.0230.06020.54
5.6.280.0100.06820.77
5.6.270.0100.05720.97
5.6.260.0200.05320.88
5.6.250.0070.06320.71
5.6.240.0080.07320.67
5.6.230.0120.07220.67
5.6.220.0150.07020.61
5.6.210.0170.05720.64
5.6.200.0100.07221.01
5.6.190.0100.06720.94
5.6.180.0170.07020.99
5.6.170.0120.07520.88
5.6.160.0120.06220.80
5.6.150.0150.06520.98
5.6.140.0100.06220.94
5.6.130.0070.07020.93
5.6.120.0080.06320.96
5.6.110.0020.08320.86
5.6.100.0150.06720.95
5.6.90.0130.07520.83
5.6.80.0130.06220.22
5.6.70.0120.06320.38
5.6.60.0150.06320.30
5.6.50.0130.07820.35
5.6.40.0170.05820.25
5.6.30.0150.06220.20
5.6.20.0080.07020.26
5.6.10.0050.06820.26
5.6.00.0180.06020.18
5.5.380.0100.06318.89
5.5.370.0120.07018.94
5.5.360.0080.06718.89
5.5.350.0100.06518.92
5.5.340.0080.06519.25
5.5.330.0170.05019.39
5.5.320.0150.06819.39
5.5.310.0020.08219.37
5.5.300.0150.06519.32
5.5.290.0080.06519.29
5.5.280.0080.06819.28
5.5.270.0080.07019.26
5.5.260.0100.07519.37
5.5.250.0150.06819.06
5.5.240.0070.05218.72
5.5.230.0070.06718.59
5.5.220.0050.07018.75
5.5.210.0080.07818.61
5.5.200.0130.07718.62
5.5.190.0080.06518.77
5.5.180.0050.07718.71
5.5.160.0120.07218.72
5.5.150.0120.07318.63
5.5.140.0170.06018.74
5.5.130.0130.06718.63
5.5.120.0080.06718.67
5.5.110.0030.06518.63
5.5.100.0020.07218.58
5.5.90.0150.06818.65
5.5.80.0080.06818.59
5.5.70.0080.06518.63
5.5.60.0130.05818.51
5.5.50.0170.05318.55
5.5.40.0150.06218.64
5.5.30.0070.07218.59
5.5.20.0120.06718.62
5.5.10.0100.05318.54
5.5.00.0130.06218.49
5.4.450.0120.05319.18
5.4.440.0130.06819.18
5.4.430.0120.06319.36
5.4.420.0170.06719.25
5.4.410.0100.05319.19
5.4.400.0080.06518.86
5.4.390.0050.05718.93
5.4.380.0100.07818.93
5.4.370.0070.07218.86
5.4.360.0130.07018.93
5.4.350.0050.06818.92
5.4.340.0080.05318.81
5.4.320.0120.06218.91
5.4.310.0150.05519.01
5.4.300.0130.06319.02
5.4.290.0130.06018.84
5.4.280.0170.06518.83
5.4.270.0130.06318.96
5.4.260.0130.06019.01
5.4.250.0120.06318.78
5.4.240.0120.06318.87
5.4.230.0070.07018.69
5.4.220.0130.06318.95
5.4.210.0080.06518.70
5.4.200.0100.07018.90
5.4.190.0100.07218.87
5.4.180.0070.06518.85
5.4.170.0070.06318.88
5.4.160.0130.06218.91
5.4.150.0170.07018.85
5.4.140.0100.06516.40
5.4.130.0130.06216.43
5.4.120.0120.06316.40
5.4.110.0120.06316.34
5.4.100.0070.06016.44
5.4.90.0080.04716.40
5.4.80.0070.05016.41
5.4.70.0120.05816.30
5.4.60.0050.07316.47
5.4.50.0080.05816.33
5.4.40.0030.05016.40
5.4.30.0130.06016.32
5.4.20.0080.05816.30
5.4.10.0080.06316.38
5.4.00.0120.06315.82
5.3.290.0120.06814.73
5.3.280.0130.07214.64
5.3.270.0050.08014.58
5.3.260.0170.07014.65
5.3.250.0100.06814.64
5.3.240.0100.07214.60
5.3.230.0030.07714.66
5.3.220.0130.06214.59
5.3.210.0200.06814.54
5.3.200.0120.06714.65
5.3.190.0220.06014.53
5.3.180.0120.07814.60
5.3.170.0080.06314.62
5.3.160.0150.07514.69
5.3.150.0050.05214.58
5.3.140.0080.06814.60
5.3.130.0080.06314.69
5.3.120.0130.06314.55
5.3.110.0070.07014.58
5.3.100.0100.07714.21
5.3.90.0180.05814.20
5.3.80.0100.07214.23
5.3.70.0030.07014.19
5.3.60.0120.06314.06
5.3.50.0130.06314.13
5.3.40.0050.06814.20
5.3.30.0050.06514.02
5.3.20.0050.06814.03
5.3.10.0050.06514.06
5.3.00.0070.06713.96

preferences:
38.83 ms | 400 KiB | 5 Q