3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ public static $alphabet = 'ABCDEFGHIKLMNOPQRSTVXYZabcdefghiklmnopqrstvxyz'; public static function shorten($number) { $alphabet = self::$alphabet; $base = strlen($alphabet); $number = intval($number, 10); $shortened = ""; while ($number > 0) { $remainder = $number % $base; $shortened = $alphabet[$remainder] . $shortened; $number = (int) ($number / $base); } return $shortened; } public static function unshorten($string) { $alphabet = self::$alphabet; $base = strlen($alphabet); $length = strlen($string); $returnVal = 0; for ($i=$length-1; $i >= 0; --$i) { $ind = strpos($alphabet, $string[$i]); if ($ind === false) { return false; } $returnVal += (int)($alphabet[$ind] * pow($base, $i)); } return $returnVal; } } $shortened = Foo::shorten(12343336363636636); echo $shortened . "\n"; var_dump(Foo::unshorten($shortened));

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.0120.00316.63
8.3.60.0120.00618.55
8.3.50.0120.00522.04
8.3.40.0070.00718.84
8.3.30.0080.00819.13
8.3.20.0000.00820.33
8.3.10.0040.00422.09
8.3.00.0040.00422.34
8.2.190.0060.01218.28
8.2.180.0150.00018.41
8.2.170.0100.00622.96
8.2.160.0100.00322.08
8.2.150.0100.01024.18
8.2.140.0050.00324.66
8.2.130.0080.00326.16
8.2.120.0080.00019.60
8.2.110.0030.00622.21
8.2.100.0070.00418.03
8.2.90.0050.00317.88
8.2.80.0000.00818.81
8.2.70.0040.00417.93
8.2.60.0030.00618.34
8.2.50.0050.00319.26
8.2.40.0040.00421.02
8.2.30.0070.00018.09
8.2.20.0000.00817.85
8.2.10.0090.00017.81
8.2.00.0000.00717.87
8.1.280.0100.01025.92
8.1.270.0050.00322.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.98
8.1.230.0060.00617.83
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0030.00617.36
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0100.00018.32
8.1.160.0030.00618.79
8.1.150.0030.00618.67
8.1.140.0070.00017.37
8.1.130.0030.00317.84
8.1.120.0040.00417.38
8.1.110.0040.00417.45
8.1.100.0030.00317.42
8.1.90.0000.00717.26
8.1.80.0030.00317.36
8.1.70.0030.00317.45
8.1.60.0040.00417.51
8.1.50.0030.00517.49
8.1.40.0050.00317.45
8.1.30.0000.00817.70
8.1.20.0030.00617.56
8.1.10.0060.00317.49
8.1.00.0000.00817.55
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0040.00418.36
8.0.270.0000.00717.18
8.0.260.0030.00316.81
8.0.250.0070.00016.99
8.0.240.0040.00417.03
8.0.230.0000.00716.90
8.0.220.0030.00316.88
8.0.210.0030.00316.85
8.0.200.0040.00417.00
8.0.190.0030.00316.91
8.0.180.0000.00717.04
8.0.170.0040.00416.89
8.0.160.0000.00816.90
8.0.150.0000.00716.92
8.0.140.0000.00816.87
8.0.130.0000.00613.35
8.0.120.0000.00816.91
8.0.110.0040.00416.98
8.0.100.0040.00416.76
8.0.90.0070.00016.91
8.0.80.0080.00816.95
8.0.70.0000.00717.02
8.0.60.0050.00316.79
8.0.50.0000.00816.81
8.0.30.0150.00317.01
8.0.20.0050.01617.40
8.0.10.0000.01017.12
8.0.00.0120.00916.80
7.4.330.0050.00015.00
7.4.320.0030.00316.52
7.4.300.0060.00016.39
7.4.290.0000.00716.65
7.4.280.0000.00816.57
7.4.270.0030.00316.52
7.4.260.0110.00016.43
7.4.250.0030.00516.38
7.4.240.0040.00416.57
7.4.230.0000.00716.43
7.4.220.0130.00616.52
7.4.210.0050.01016.52
7.4.200.0040.00416.68
7.4.190.0030.00316.41
7.4.160.0100.00716.50
7.4.150.0110.00717.40
7.4.140.0100.01017.86
7.4.130.0100.00716.64
7.4.120.0100.01016.60
7.4.110.0100.00716.68
7.4.100.0100.00716.60
7.4.90.0090.00916.54
7.4.80.0110.00619.39
7.4.70.0110.00516.74
7.4.60.0100.00716.66
7.4.50.0040.00416.36
7.4.40.0110.00022.77
7.4.30.0100.00616.54
7.4.00.0060.00914.88
7.3.330.0000.00513.41
7.3.320.0020.00213.20
7.3.310.0000.00616.27
7.3.300.0000.00716.38
7.3.290.0000.01916.45
7.3.280.0060.01116.42
7.3.270.0060.01317.40
7.3.260.0120.00616.65
7.3.250.0090.00816.48
7.3.240.0130.00316.43
7.3.230.0170.00016.41
7.3.210.0070.01016.53
7.3.200.0110.00619.39
7.3.190.0100.00816.43
7.3.180.0080.00916.67
7.3.170.0090.00616.57
7.3.160.0090.01216.46
7.3.120.0060.01015.02
7.3.10.0120.00216.35
7.3.00.0110.00516.48
7.2.330.0110.00816.76
7.2.320.0180.00616.60
7.2.310.0110.00616.59
7.2.300.0100.00716.55
7.2.290.0070.01316.39
7.2.130.0060.01016.63
7.2.120.0090.00916.57
7.2.110.0110.00616.77
7.2.100.0060.00916.67
7.2.90.0050.01316.68
7.2.80.0080.00916.39
7.2.70.0100.00816.68
7.2.60.0060.00816.82
7.2.50.0080.00916.51
7.2.40.0120.00516.84
7.2.30.0090.00816.85
7.2.20.0090.01016.80
7.2.10.0070.00816.76
7.2.00.0070.00616.92
7.1.250.0090.00615.66
7.1.240.0040.01115.60
7.1.230.0100.00615.89
7.1.220.0060.00815.84
7.1.210.0060.00915.92
7.1.200.0060.00515.84
7.1.190.0080.00016.04
7.1.180.0060.00315.80
7.1.170.0030.01015.80
7.1.160.0040.00815.73
7.1.150.0070.00715.93
7.1.140.0000.01415.68
7.1.130.0070.00715.70
7.1.120.0030.00615.98
7.1.110.0080.00415.99
7.1.100.0070.00715.71
7.1.90.0060.00915.81
7.1.80.0080.00815.89
7.1.70.0090.00716.43
7.1.60.0080.01017.90
7.1.50.0050.01416.48
7.1.40.0040.00815.84
7.1.30.0040.01115.53
7.1.20.0030.01015.78
7.1.10.0030.00915.75
7.1.00.0060.04019.06
7.0.320.0000.01015.57
7.0.310.0040.01115.41
7.0.300.0000.01415.25
7.0.290.0060.00615.36
7.0.280.0000.01515.19
7.0.270.0030.00715.31
7.0.260.0060.00615.43
7.0.250.0030.01015.45
7.0.240.0030.00915.51
7.0.230.0030.01015.56
7.0.220.0030.00915.54
7.0.210.0070.00315.49
7.0.200.0030.00716.00
7.0.190.0090.00615.43
7.0.180.0060.00915.17
7.0.170.0060.00615.44
7.0.160.0030.01015.59
7.0.150.0050.00515.53
7.0.140.0040.04118.66
7.0.130.0120.00015.55
7.0.120.0030.00915.57
7.0.110.0060.00615.54
7.0.100.0040.00415.45
7.0.90.0100.00315.48
7.0.80.0000.01215.50
7.0.70.0080.00015.24
7.0.60.0030.03817.61
7.0.50.0050.03116.72
7.0.40.0070.04716.84
7.0.30.0150.04416.81
7.0.20.0080.03316.83
7.0.10.0070.03516.79
7.0.00.0120.03216.97
5.6.380.0000.01414.51
5.6.370.0060.00814.32
5.6.360.0090.00614.62
5.6.350.0000.00914.41
5.6.340.0070.00714.55
5.6.330.0100.00314.62
5.6.320.0090.00614.68
5.6.310.0070.00414.82
5.6.300.0030.01014.39
5.6.290.0150.00014.30
5.6.280.0130.03317.65
5.6.270.0000.01514.51
5.6.260.0080.00314.41
5.6.250.0000.01114.69
5.6.240.0060.00614.42
5.6.230.0100.00314.52
5.6.220.0120.00414.52
5.6.210.0070.04017.46
5.6.200.0030.04716.25
5.6.190.0080.03017.47
5.6.180.0130.03017.45
5.6.170.0120.04917.55
5.6.160.0080.04217.39
5.6.150.0100.03416.51
5.6.140.0050.02716.34
5.6.130.0070.02216.38
5.6.120.0040.03717.83
5.6.110.0080.04317.77
5.6.100.0050.03617.97
5.6.90.0050.04717.64
5.6.80.0030.04617.36
5.6.70.0030.00714.08
5.6.60.0140.00014.05
5.6.50.0000.00814.49
5.6.40.0070.00714.33
5.6.30.0060.00314.23
5.6.20.0070.00714.51
5.6.10.0040.00814.45
5.6.00.0060.00614.39
5.5.380.0000.00611.19
5.5.370.0030.00611.39
5.5.360.0050.00011.65
5.5.350.0070.04416.08
5.5.340.0060.02314.71
5.5.330.0050.03715.93
5.5.320.0030.03315.77
5.5.310.0160.04015.75
5.5.300.0080.02514.55
5.5.290.0050.03414.58
5.5.280.0110.04016.18
5.5.270.0080.02216.10
5.5.260.0020.04315.92
5.5.250.0090.02115.98
5.5.240.0060.04315.74
5.5.230.0030.00611.07
5.5.220.0060.00611.29
5.5.210.0060.00611.27
5.5.200.0030.00711.36
5.5.190.0040.00711.42
5.5.180.0060.00311.28
5.5.170.0060.01014.12
5.5.160.0000.00811.32
5.5.150.0070.00411.32
5.5.140.0050.00510.79
5.5.130.0050.00011.26
5.5.120.0000.01211.19
5.5.110.0030.00711.17
5.5.100.0040.00711.32
5.5.90.0040.00711.44
5.5.80.0040.00411.37
5.5.70.0060.00611.32
5.5.60.0080.00411.13
5.5.50.0050.00311.42
5.5.40.0050.00211.34
5.5.30.0030.00711.20
5.5.20.0060.00611.09
5.5.10.0090.00311.20
5.5.00.0040.00810.97
5.4.450.0180.03515.50
5.4.440.0350.03315.38
5.4.430.0080.02815.46
5.4.420.0280.03215.30
5.4.410.0080.03215.03
5.4.400.0650.00314.99
5.4.390.0440.00214.81
5.4.380.0110.04414.81
5.4.370.0120.02914.88
5.4.360.0100.03015.00
5.4.350.0100.03414.81
5.4.340.0050.03814.90
5.4.330.0000.00710.85
5.4.320.0020.02711.87
5.4.310.0050.02411.69
5.4.300.0040.02611.96
5.4.290.0080.02211.72
5.4.280.0060.02011.75
5.4.270.0100.03114.89
5.4.260.0100.03014.98
5.4.250.0150.03315.11
5.4.240.0090.03715.14
5.4.230.0070.03714.98
5.4.220.0060.02814.85
5.4.210.0030.04314.89
5.4.200.0080.04215.01
5.4.190.0080.03214.99
5.4.180.0030.04515.20
5.4.170.0080.04214.82
5.4.160.0110.03115.00
5.4.150.0080.03614.89
5.4.140.0090.02713.87
5.4.130.0110.03413.80
5.4.120.0030.04213.81
5.4.110.0120.03013.78
5.4.100.0070.03513.84
5.4.90.0100.03513.88
5.4.80.0030.03113.74
5.4.70.0030.04013.93
5.4.60.0050.02813.63
5.4.50.0090.02813.63
5.4.40.0070.02613.61
5.4.30.0070.02713.72
5.4.20.0060.03813.89
5.4.10.0050.03913.74
5.4.00.0050.02813.59
5.3.290.0040.02511.79
5.3.280.0080.03512.69
5.3.270.0120.03512.58
5.3.260.0090.03012.69
5.3.250.0100.03712.64
5.3.240.0120.02312.44
5.3.230.0070.02812.64
5.3.220.0090.02712.55
5.3.210.0030.03312.55
5.3.200.0050.03112.52
5.3.190.0070.03212.53
5.3.180.0050.03112.61
5.3.170.0060.03812.54
5.3.160.0140.02712.65
5.3.150.0070.03912.67
5.3.140.0050.03512.61
5.3.130.0050.03512.67
5.3.120.0030.03912.57
5.3.110.0120.03712.60
5.3.100.0030.03112.31
5.3.90.0100.03312.31
5.3.80.0070.03412.27
5.3.70.0080.02812.30
5.3.60.0050.03012.28
5.3.50.0050.03612.18
5.3.40.0040.03112.18
5.3.30.0070.03712.33
5.3.20.0100.02312.12
5.3.10.0090.02611.96
5.3.00.0060.03012.10
5.2.170.0080.02210.41
5.2.160.0050.03210.58
5.2.150.0030.03210.53
5.2.140.0060.02610.54
5.2.130.0100.01810.51
5.2.120.0060.02510.51
5.2.110.0020.02210.46
5.2.100.0110.02810.51
5.2.90.0060.02310.52
5.2.80.0050.03210.38
5.2.70.0070.03110.42
5.2.60.0060.02210.43
5.2.50.0110.02610.51
5.2.40.0080.02810.41
5.2.30.0050.02310.38
5.2.20.0050.02510.44
5.2.10.0050.02110.38
5.2.00.0070.02010.32
5.1.60.0050.0219.97
5.1.50.0120.0129.92
5.1.40.0030.0239.87
5.1.30.0050.02810.12
5.1.20.0000.02810.14
5.1.10.0080.0259.93
5.1.00.0090.0229.99
5.0.50.0030.0169.24
5.0.40.0050.0209.12
5.0.30.0050.0289.07
5.0.20.0080.0109.09
5.0.10.0090.0139.05
5.0.00.0080.0249.05
4.4.90.0030.0147.85
4.4.80.0050.0107.85
4.4.70.0030.0187.85
4.4.60.0030.0167.85
4.4.50.0020.0157.85
4.4.40.0030.0257.85
4.4.30.0030.0117.90
4.4.20.0060.0157.86
4.4.10.0050.0147.86
4.4.00.0020.0267.85
4.3.110.0000.0147.85
4.3.100.0000.0157.85
4.3.90.0020.0157.85
4.3.80.0080.0187.85
4.3.70.0020.0157.85
4.3.60.0010.0167.85
4.3.50.0020.0157.85
4.3.40.0050.0207.85
4.3.30.0000.0157.85
4.3.20.0000.0177.85
4.3.10.0040.0107.85
4.3.00.0080.0138.51

preferences:
52.67 ms | 401 KiB | 5 Q