3v4l.org

run code in 300+ PHP versions simultaneously
<?php $colLetter = ''; $colLetter = function($num) use(&$colLetter) { $letters=array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); //if the number is greater than 26, calculate to get the next letters if($num > 26) { //divide the number by 26 and get rid of the decimal $comp = floor($num / 26); //add the letter to the end of the result and return it if ($comp != 0) { // don't subtract 1 if the comparative variable is greater than 0 return $colLetter($comp) . $letters[($num - $comp * 26)]; } else { return $colLetter($comp) . $letters[($num - $comp * 26) - 1]; } } return $letters[($num-1)]; }; $colLetter(1); $colLetter(2);

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.00716.75
8.3.50.0100.00618.04
8.3.40.0030.01118.88
8.3.30.0160.00019.22
8.3.20.0040.00420.16
8.3.10.0040.00421.79
8.3.00.0020.00522.44
8.2.180.0110.00418.29
8.2.170.0110.00722.96
8.2.160.0000.02022.13
8.2.150.0000.00925.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00717.75
8.2.110.0090.00020.94
8.2.100.0090.00317.78
8.2.90.0050.00317.85
8.2.80.0030.00519.37
8.2.70.0000.00817.93
8.2.60.0000.00818.05
8.2.50.0040.00418.10
8.2.40.0070.00020.28
8.2.30.0090.00318.14
8.2.20.0040.00417.76
8.2.10.0050.00218.19
8.2.00.0000.00718.12
8.1.280.0080.00625.92
8.1.270.0070.01020.22
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0090.00323.80
8.1.230.0040.00720.85
8.1.220.0080.00017.74
8.1.210.0060.00318.79
8.1.200.0030.00617.35
8.1.190.0030.00617.22
8.1.180.0080.00018.10
8.1.170.0040.00418.59
8.1.160.0040.00422.07
8.1.150.0000.00720.61
8.1.140.0030.00617.46
8.1.130.0000.00717.46
8.1.120.0040.00417.46
8.1.110.0050.00217.43
8.1.100.0020.00517.48
8.1.90.0000.00817.52
8.1.80.0040.00417.36
8.1.70.0040.00417.46
8.1.60.0030.00617.50
8.1.50.0080.00017.48
8.1.40.0040.00417.59
8.1.30.0060.00317.49
8.1.20.0080.00017.67
8.1.10.0050.00217.55
8.1.00.0030.00617.45
8.0.300.0040.00420.09
8.0.290.0040.00416.75
8.0.280.0030.00518.37
8.0.270.0020.00517.32
8.0.260.0030.00316.82
8.0.250.0050.00316.86
8.0.240.0040.00416.80
8.0.230.0000.00716.95
8.0.220.0030.00316.88
8.0.210.0030.00516.97
8.0.200.0030.00716.94
8.0.190.0040.00416.92
8.0.180.0040.00416.95
8.0.170.0030.00516.82
8.0.160.0040.00416.87
8.0.150.0030.00316.95
8.0.140.0030.00416.86
8.0.130.0000.00613.37
8.0.120.0050.00216.83
8.0.110.0000.00716.82
8.0.100.0080.00016.92
8.0.90.0040.00416.95
8.0.80.0070.01116.80
8.0.70.0020.00516.75
8.0.60.0000.00716.88
8.0.50.0040.00416.73
8.0.30.0090.01017.02
8.0.20.0120.01217.40
8.0.10.0030.00517.12
8.0.00.0100.00816.86
7.4.330.0000.00615.08
7.4.320.0000.00616.54
7.4.300.0000.00616.53
7.4.290.0030.00316.48
7.4.280.0050.00516.52
7.4.270.0070.00016.62
7.4.260.0030.00316.39
7.4.250.0000.00716.43
7.4.240.0050.00216.62
7.4.230.0000.00716.72
7.4.220.0040.01616.56
7.4.210.0100.00516.51
7.4.200.0030.00316.31
7.4.160.0060.01016.36
7.4.150.0060.01217.40
7.4.140.0100.01217.86
7.4.130.0130.00916.45
7.4.120.0150.00316.58
7.4.110.0170.00016.56
7.4.100.0140.00716.62
7.4.90.0060.01216.39
7.4.80.0160.00619.39
7.4.70.0120.00616.51
7.4.60.0120.00416.57
7.4.50.0030.00316.47
7.4.40.0110.01416.55
7.4.30.0090.01316.63
7.4.00.0080.00415.02
7.3.330.0030.00313.26
7.3.320.0050.00013.14
7.3.310.0000.00716.33
7.3.300.0060.00016.18
7.3.290.0110.00516.27
7.3.280.0050.01216.30
7.3.270.0170.00317.40
7.3.260.0100.00716.67
7.3.250.0080.00916.43
7.3.240.0070.01016.61
7.3.230.0090.00816.42
7.3.210.0100.01016.29
7.3.200.0100.01019.39
7.3.190.0100.01016.69
7.3.180.0030.01216.32
7.3.170.0140.00816.37
7.3.160.0120.00916.37
7.3.10.0170.00316.48
7.3.00.0130.01416.31
7.2.330.0100.00716.45
7.2.320.0100.00716.63
7.2.310.0090.00916.43
7.2.300.0090.00916.47
7.2.290.0160.00916.69
7.2.130.0040.01616.75
7.2.120.0120.00716.72
7.2.110.0150.00616.70
7.2.100.0160.01216.54
7.2.90.0060.01916.60
7.2.80.0070.01116.51
7.2.70.0030.01316.89
7.2.60.0040.01116.70
7.2.50.0030.01216.72
7.2.40.0090.00616.56
7.2.30.0000.01516.50
7.2.20.0040.01116.82
7.2.10.0130.00716.53
7.2.00.0050.00917.96
7.1.250.0120.01215.55
7.1.200.0000.00915.48
7.1.100.0080.00418.21
7.1.70.0000.01117.23
7.1.60.0130.01019.59
7.1.50.0070.01616.90
7.1.00.0070.07022.35
7.0.200.0000.01016.33
7.0.60.0070.08319.91
7.0.50.0030.05017.86
7.0.40.0000.05320.40
7.0.30.0230.09020.23
7.0.20.0230.06020.19
7.0.10.0000.04320.29
7.0.00.0030.04720.30
5.6.280.0000.05721.11
5.6.210.0070.04020.51
5.6.200.0000.09318.25
5.6.190.0070.07020.50
5.6.180.3370.05020.39
5.6.170.0270.06720.54
5.6.160.0130.05020.61
5.6.150.0070.08018.25
5.6.140.0070.07318.27
5.6.130.0100.07718.14
5.6.120.0070.04021.05
5.6.110.0130.03721.02
5.6.100.0000.04321.12
5.6.90.0100.04020.98
5.6.80.0030.03720.40
5.6.70.0200.02720.52
5.5.350.0200.05020.53
5.5.340.0070.08317.99
5.5.330.0000.06320.38
5.5.320.0400.08320.30
5.5.310.0230.04020.32
5.5.300.0000.05317.93
5.5.290.0000.05018.04
5.5.280.0170.06320.78
5.5.270.0070.04020.80
5.5.260.0030.06320.98
5.5.250.0030.04020.57
5.5.240.0330.07320.38
5.4.450.0830.08319.61
5.4.440.0170.06319.47
5.4.430.0200.06319.38
5.4.420.0270.05319.62
5.4.410.0230.06319.04
5.4.400.0270.05719.14
5.4.390.0270.05019.15
5.4.380.0230.05319.23
5.4.370.0270.06319.11
5.4.360.0170.06319.06
5.4.350.0270.04719.22
5.4.340.0200.06019.29
5.4.320.0330.04719.23
5.4.310.0230.05319.12
5.4.300.0170.06319.30
5.4.290.0470.06319.14
5.4.280.0370.06319.00
5.4.270.0100.07318.84
5.4.260.0230.05019.00
5.4.250.0230.05719.25
5.4.240.0300.06719.00
5.4.230.0270.06719.14
5.4.220.0230.06018.97
5.4.210.0300.06319.11
5.4.200.0270.05016.71
5.4.190.0230.06019.19
5.4.180.0270.05019.01
5.4.170.0270.05719.18
5.4.160.0230.05718.94
5.4.150.0200.05719.01
5.4.140.0330.04016.58
5.4.130.0300.04716.55
5.4.120.0200.06016.69
5.4.110.0300.05016.41
5.4.100.0270.05716.55
5.4.90.0270.04716.34
5.4.80.0170.05316.49
5.4.70.0270.04716.52
5.4.60.0130.05716.32
5.4.50.0230.04316.53
5.4.40.0130.05716.44
5.4.30.0400.03716.41
5.4.20.0270.05016.55
5.4.10.0300.04716.48
5.4.00.0130.05316.18
5.3.290.0200.05714.66
5.3.280.0130.06014.46
5.3.270.0300.04314.58
5.3.260.0130.06314.63
5.3.250.0370.06714.52
5.3.240.0330.06714.69
5.3.230.0200.05314.60
5.3.220.0270.04714.48
5.3.210.0300.05014.48
5.3.200.0270.04714.57
5.3.190.0330.06714.56
5.3.180.0270.07014.61
5.3.170.0230.07014.53
5.3.160.0200.05014.58
5.3.150.0230.05714.65
5.3.140.0330.06714.47
5.3.130.0400.05314.41
5.3.120.0270.04714.70
5.3.110.0270.06714.57
5.3.100.0100.05713.95
5.3.90.0100.06014.04
5.3.80.0270.04014.04
5.3.70.0170.05014.05
5.3.60.0170.05014.09
5.3.50.0200.05013.85
5.3.40.0270.04714.09
5.3.30.0230.04713.93
5.3.20.0230.04313.71
5.3.10.0130.05013.52
5.3.00.0230.04713.56
5.2.170.0130.04711.01
5.2.160.0230.03011.05
5.2.150.0130.04011.08
5.2.140.0130.04310.98
5.2.130.0130.05311.04
5.2.120.0130.04311.15
5.2.110.0130.04010.95
5.2.100.0130.05010.96
5.2.90.0200.04310.95
5.2.80.0230.04010.93
5.2.70.0170.04711.03
5.2.60.0200.03311.06
5.2.50.0070.04711.00
5.2.40.0100.04310.83
5.2.30.0100.04310.77
5.2.20.0170.04010.90
5.2.10.0200.04010.76
5.2.00.0200.04310.63
5.1.60.0170.05010.04
5.1.50.0230.04010.05
5.1.40.0130.0379.87
5.1.30.0270.03710.51
5.1.20.0230.02710.30
5.1.10.0200.04010.04
5.1.00.0200.03310.16
5.0.50.0070.0308.46
5.0.40.0070.0308.43
5.0.30.0130.0538.20
5.0.20.0100.0408.07
5.0.10.0070.0408.31
5.0.00.0170.0478.38
4.4.90.0130.0275.84
4.4.80.0170.0235.79
4.4.70.0100.0275.74
4.4.60.0070.0305.74
4.4.50.0170.0235.85
4.4.40.0100.0435.84
4.4.30.0100.0205.78
4.4.20.0100.0205.81
4.4.10.0000.0275.88
4.4.00.0100.0435.87
4.3.110.0030.0275.75
4.3.100.0030.0275.75
4.3.90.0030.0235.66
4.3.80.0100.0405.78
4.3.70.0070.0275.65
4.3.60.0030.0235.70
4.3.50.0030.0235.66
4.3.40.0100.0335.67
4.3.30.0000.0334.43
4.3.20.0100.0234.47
4.3.10.0070.0204.45
4.3.00.0070.0277.20

preferences:
31.53 ms | 400 KiB | 5 Q