3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format_num($num, $precision = 2) { if ($num >= 1000) { $n_format = number_format($num/1000,$precision).'K'; } else { $n_format = $num; } return $n_format; } echo format_num(1200,1); echo format_num(1230000); echo format_num(1234000000,3);

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.0110.01116.75
8.3.50.0150.00222.93
8.3.40.0140.00718.92
8.3.30.0080.00619.09
8.3.20.0020.00520.16
8.3.10.0040.00423.65
8.3.00.0040.00419.14
8.2.180.0040.01116.38
8.2.170.0100.00322.96
8.2.160.0070.00720.47
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0110.00726.16
8.2.120.0000.00821.04
8.2.110.0040.00422.29
8.2.100.0080.00318.34
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0110.00017.60
8.2.60.0030.00518.04
8.2.50.0060.00318.07
8.2.40.0050.00320.07
8.2.30.0070.00018.08
8.2.20.0000.00817.73
8.2.10.0000.00718.11
8.2.00.0000.00717.64
8.1.280.0070.00725.92
8.1.270.0110.00722.22
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0090.00023.97
8.1.230.0110.00019.10
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0040.00417.47
8.1.190.0080.00017.48
8.1.180.0080.00018.10
8.1.170.0060.00618.52
8.1.160.0040.00421.91
8.1.150.0000.00818.98
8.1.140.0000.00717.51
8.1.130.0000.00717.87
8.1.120.0030.00317.41
8.1.110.0080.00017.39
8.1.100.0030.00517.48
8.1.90.0030.00517.41
8.1.80.0000.00817.50
8.1.70.0000.00717.47
8.1.60.0040.00417.47
8.1.50.0050.00417.47
8.1.40.0030.00517.54
8.1.30.0080.00017.64
8.1.20.0000.00717.71
8.1.10.0020.00517.52
8.1.00.0000.00717.39
8.0.300.0070.00018.77
8.0.290.0030.00716.75
8.0.280.0000.00718.50
8.0.270.0030.00317.34
8.0.260.0030.00317.22
8.0.250.0000.00716.89
8.0.240.0030.00316.99
8.0.230.0000.00717.04
8.0.220.0000.00616.91
8.0.210.0030.00316.94
8.0.200.0060.00016.88
8.0.190.0070.00417.00
8.0.180.0000.00716.97
8.0.170.0000.00716.89
8.0.160.0000.00716.88
8.0.150.0000.00716.81
8.0.140.0000.00716.91
8.0.130.0030.00313.38
8.0.120.0030.00616.93
8.0.110.0000.00816.93
8.0.100.0000.00816.81
8.0.90.0040.00416.87
8.0.80.0060.01116.93
8.0.70.0040.00417.00
8.0.60.0040.00416.86
8.0.50.0040.00416.82
8.0.30.0100.01017.12
8.0.20.0080.01417.43
8.0.10.0050.00216.90
8.0.00.0050.01316.97
7.4.330.0000.00615.07
7.4.320.0000.00716.41
7.4.300.0000.00616.66
7.4.290.0000.00816.62
7.4.280.0080.00416.68
7.4.270.0000.00716.64
7.4.260.0000.00616.52
7.4.250.0040.00416.66
7.4.240.0020.00516.68
7.4.230.0030.00516.63
7.4.220.0090.00916.57
7.4.210.0130.00616.60
7.4.200.0030.00316.65
7.4.160.0110.00616.45
7.4.150.0160.00317.40
7.4.140.0070.01417.86
7.4.130.0070.00916.61
7.4.120.0140.00516.52
7.4.110.0090.00616.62
7.4.100.0070.01116.35
7.4.90.0080.00816.53
7.4.80.0170.00019.39
7.4.70.0100.01316.58
7.4.60.0100.00616.52
7.4.50.0040.00416.36
7.4.40.0130.01016.49
7.4.30.0120.00316.51
7.4.00.0090.00614.80
7.3.330.0050.00013.45
7.3.320.0060.00013.41
7.3.310.0000.00716.29
7.3.300.0030.00316.30
7.3.290.0110.00916.44
7.3.280.0100.00716.41
7.3.270.0130.01017.40
7.3.260.0170.00616.56
7.3.250.0080.00916.48
7.3.240.0030.01316.47
7.3.230.0110.00716.64
7.3.210.0070.01016.30
7.3.200.0040.01719.39
7.3.190.0070.01416.48
7.3.180.0030.01216.41
7.3.170.0080.00816.51
7.3.160.0060.01316.67
7.3.10.0120.00316.85
7.3.00.0100.00716.84
7.2.330.0230.01616.83
7.2.320.0060.01016.59
7.2.310.0120.00816.58
7.2.300.0130.00716.26
7.2.290.0070.01016.44
7.2.130.0030.01216.78
7.2.120.0110.00316.91
7.2.110.0070.00716.91
7.2.100.0030.00717.09
7.2.90.0070.00716.66
7.2.80.0090.00016.88
7.2.70.0030.01016.88
7.2.60.0110.00416.80
7.2.50.0130.00017.05
7.2.40.0100.00316.97
7.2.30.0100.00716.98
7.2.20.0090.00917.00
7.2.10.0060.00617.06
7.2.00.0040.01017.99
7.1.250.0030.00915.78
7.1.100.0040.00717.88
7.1.70.0000.00817.22
7.1.60.0160.00319.40
7.1.50.0070.01017.02
7.1.00.0070.07322.43
7.0.200.0000.00816.68
7.0.140.0000.07722.00
7.0.60.0130.05319.86
7.0.50.0100.06017.84
7.0.40.0100.08020.31
7.0.30.0370.06720.09
7.0.20.0230.04020.23
7.0.10.0170.07720.06
7.0.00.0030.04320.06
5.6.280.0000.07721.09
5.6.210.0070.08320.73
5.6.200.0000.08318.29
5.6.190.0000.08320.48
5.6.180.0300.07320.48
5.6.170.0300.08320.54
5.6.160.0070.05320.50
5.6.150.0100.03718.25
5.6.140.0000.05018.19
5.6.130.0100.07018.17
5.6.120.0130.06321.01
5.6.110.0130.09021.12
5.6.100.0170.06721.13
5.6.90.0100.08021.14
5.6.80.0130.07320.41
5.5.350.0200.07720.38
5.5.340.0100.07717.99
5.5.330.0100.08320.35
5.5.320.0100.07720.48
5.5.310.0400.06720.28
5.5.300.0070.07017.99
5.5.290.0030.08717.95
5.5.280.0100.08720.98
5.5.270.0130.04720.93
5.5.260.0070.04320.84
5.5.250.0130.06320.58
5.5.240.0170.07720.27
5.4.450.0470.05019.55
5.4.440.0100.05019.41
5.4.430.0270.04319.39
5.4.420.0230.05019.45
5.4.410.0270.03719.25
5.4.400.0330.04019.07
5.4.390.0400.04019.23
5.4.380.0530.05718.76
5.4.370.0470.06718.78
5.4.360.0370.05318.80
5.4.350.0300.06718.90
5.4.340.0530.05318.84
5.4.320.0030.03912.51
5.4.310.0070.04112.51
5.4.300.0090.03912.51
5.4.290.0080.04212.50
5.4.280.0090.03312.40
5.4.270.0030.03912.40
5.4.260.0060.03812.40
5.4.250.0050.03812.40
5.4.240.0100.03712.40
5.4.230.0080.03912.39
5.4.220.0060.03812.39
5.4.210.0070.03312.39
5.4.200.0100.03312.39
5.4.190.0100.03512.39
5.4.180.0080.04412.39
5.4.170.0070.03512.40
5.4.160.0040.03812.40
5.4.150.0070.03712.39
5.4.140.0040.04112.07
5.4.130.0070.03612.06
5.4.120.0050.03512.02
5.4.110.0050.03612.02
5.4.100.0040.03712.01
5.4.90.0060.04612.02
5.4.80.0050.04112.02
5.4.70.0060.04212.01
5.4.60.0060.03812.01
5.4.50.0060.03412.01
5.4.40.0090.03112.00
5.4.30.0050.03712.00
5.4.20.0070.03512.00
5.4.10.0040.03612.00
5.4.00.0070.03811.49
5.3.290.0090.03512.80
5.3.280.0060.03712.71
5.3.270.0050.03912.72
5.3.260.0060.03912.72
5.3.250.0070.03612.71
5.3.240.0050.03712.72
5.3.230.0060.03712.71
5.3.220.0040.03912.68
5.3.210.0070.03812.68
5.3.200.0080.03412.68
5.3.190.0050.03812.67
5.3.180.0060.03612.68
5.3.170.0090.03312.67
5.3.160.0040.03812.67
5.3.150.0050.03812.67
5.3.140.0080.03412.66
5.3.130.0030.04112.65
5.3.120.0080.03712.66
5.3.110.0080.03612.66
5.3.100.0090.03712.12
5.3.90.0080.03712.11
5.3.80.0040.03712.10
5.3.70.0060.03512.10
5.3.60.0070.03412.08
5.3.50.0020.03812.02
5.3.40.0060.03512.03
5.3.30.0070.03411.98
5.3.20.0060.03511.76
5.3.10.0040.03611.73
5.3.00.0080.03311.72
5.2.170.0050.0299.26
5.2.160.0040.0319.26
5.2.150.0050.0349.26
5.2.140.0060.0369.26
5.2.130.0030.0309.22
5.2.120.0050.0299.22
5.2.110.0040.0339.22
5.2.100.0060.0279.21
5.2.90.0040.0309.21
5.2.80.0050.0309.21
5.2.70.0060.0309.21
5.2.60.0060.0299.17
5.2.50.0040.0319.14
5.2.40.0040.0299.12
5.2.30.0060.0289.09
5.2.20.0050.0279.07
5.2.10.0030.0298.98
5.2.00.0050.0288.84
5.1.60.0090.0238.13
5.1.50.0030.0258.13
5.1.40.0050.0238.10
5.1.30.0050.0258.46
5.1.20.0030.0278.47
5.1.10.0030.0278.20
5.1.00.0040.0268.21
5.0.50.0020.0226.68
5.0.40.0020.0206.55
5.0.30.0050.0286.35
5.0.20.0000.0226.32
5.0.10.0020.0216.30
5.0.00.0070.0316.29
4.4.90.0050.0144.77
4.4.80.0040.0174.75
4.4.70.0010.0194.75
4.4.60.0030.0184.75
4.4.50.0050.0144.77
4.4.40.0030.0294.70
4.4.30.0020.0164.76
4.4.20.0040.0144.84
4.4.10.0040.0144.85
4.4.00.0050.0224.76
4.3.110.0040.0144.67
4.3.100.0010.0164.66
4.3.90.0020.0254.64
4.3.80.0030.0234.58
4.3.70.0020.0154.63
4.3.60.0030.0214.63
4.3.50.0040.0184.63
4.3.40.0040.0224.54
4.3.30.0020.0243.30
4.3.20.0010.0163.28
4.3.10.0020.0153.26
4.3.00.0000.01315.63

preferences:
47.79 ms | 401 KiB | 5 Q