3v4l.org

run code in 300+ PHP versions simultaneously
<?php function nice_number($n) { // first strip any formatting; $n = (0 + str_replace(",", "", $n)); // is this a number? if (!is_numeric($n)) return false; // now filter it; $str = ''; if ($n > 1000000000000) { $str = round(($n / 1000000000000), 0) . ' tn '; $str .= $n % 1000000000000 > 0 ? nice_number($n % 1000000000000) : ''; return $str; } else if ($n > 1000000000) { $str = round(($n / 1000000000), 0) . ' bn '; $str .= $n % 1000000000 > 0 ? nice_number($n % 1000000000) : ''; return $str; } else if ($n > 1000000) { $str = round(($n / 1000000), 0) . ' mn '; $str .= $n % 1000000 > 0 ? nice_number($n % 1000000) : ''; return $str; } else if ($n > 1000) return round(($n / 1000), 0) . ' K '; return number_format($n); } echo nice_number(1300200000);

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.00418.43
8.3.50.0140.00922.12
8.3.40.0090.00618.80
8.3.30.0030.01019.05
8.3.20.0000.00920.34
8.3.10.0080.00022.16
8.3.00.0080.00022.58
8.2.180.0120.00816.63
8.2.170.0140.00722.96
8.2.160.0100.01020.98
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0050.00317.75
8.2.110.0030.00622.30
8.2.100.0060.00617.84
8.2.90.0030.00519.25
8.2.80.0080.00018.05
8.2.70.0090.00017.75
8.2.60.0000.00818.16
8.2.50.0000.00818.07
8.2.40.0040.00418.34
8.2.30.0040.00418.07
8.2.20.0000.00817.73
8.2.10.0050.00317.82
8.2.00.0000.00717.75
8.1.280.0070.01025.92
8.1.270.0050.00322.18
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0050.00523.96
8.1.230.0060.00619.18
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0030.00517.65
8.1.180.0030.00618.10
8.1.170.0040.00418.54
8.1.160.0000.00822.03
8.1.150.0000.00718.56
8.1.140.0040.00417.39
8.1.130.0000.00817.90
8.1.120.0050.00217.54
8.1.110.0040.00417.43
8.1.100.0000.00717.51
8.1.90.0040.00417.40
8.1.80.0000.00717.59
8.1.70.0000.00817.41
8.1.60.0060.00317.59
8.1.50.0040.00417.65
8.1.40.0040.00417.51
8.1.30.0000.00817.64
8.1.20.0000.00817.77
8.1.10.0000.00817.52
8.1.00.0080.00017.41
8.0.300.0000.00718.77
8.0.290.0050.00317.18
8.0.280.0000.00718.42
8.0.270.0030.00317.32
8.0.260.0000.00616.83
8.0.250.0070.00017.11
8.0.240.0050.00316.92
8.0.230.0000.00717.08
8.0.220.0080.00016.93
8.0.210.0030.00317.04
8.0.200.0040.00417.08
8.0.190.0040.00417.05
8.0.180.0040.00416.96
8.0.170.0030.00517.05
8.0.160.0050.00217.03
8.0.150.0000.00816.91
8.0.140.0040.00416.89
8.0.130.0000.00613.47
8.0.120.0040.00416.95
8.0.110.0050.00217.02
8.0.100.0030.00516.89
8.0.90.0000.00716.88
8.0.80.0090.00617.01
8.0.70.0040.00416.85
8.0.60.0050.00316.89
8.0.50.0070.00017.14
8.0.30.0150.00617.19
8.0.20.0130.00717.40
8.0.10.0050.00317.03
8.0.00.0080.00816.92
7.4.330.0050.00015.20
7.4.320.0040.00416.68
7.4.300.0030.00316.63
7.4.290.0000.00616.56
7.4.280.0030.00316.57
7.4.270.0050.00316.66
7.4.260.0030.00516.70
7.4.250.0080.00016.43
7.4.240.0050.00216.60
7.4.230.0070.00016.70
7.4.220.0170.00916.74
7.4.210.0060.00816.66
7.4.200.0070.00016.57
7.4.190.0030.00316.53
7.4.160.0070.01016.61
7.4.150.0160.00317.40
7.4.140.0090.01317.86
7.4.130.0050.01316.68
7.4.120.0060.01116.66
7.4.110.0090.00916.64
7.4.100.0060.01216.53
7.4.90.0100.01016.33
7.4.80.0140.01119.39
7.4.70.0110.00616.55
7.4.60.0080.00816.73
7.4.50.0050.00016.45
7.4.40.0100.00322.77
7.4.30.0090.00616.47
7.4.00.0100.00715.02
7.3.330.0050.00013.40
7.3.320.0030.00313.36
7.3.310.0030.00316.44
7.3.300.0030.00316.35
7.3.290.0070.01316.48
7.3.280.0100.01016.42
7.3.270.0110.00517.40
7.3.260.0030.01416.41
7.3.250.0080.00916.56
7.3.240.0100.00716.63
7.3.230.0100.00716.61
7.3.210.0100.01016.74
7.3.200.0130.00619.39
7.3.190.0130.00916.74
7.3.180.0060.00916.69
7.3.170.0110.00516.78
7.3.160.0100.01016.37
7.3.120.0110.00414.59
7.3.10.0040.01116.52
7.3.00.0210.00016.33
7.2.330.0080.01416.88
7.2.320.0130.01016.88
7.2.310.0120.00616.81
7.2.300.0070.01516.73
7.2.290.0070.01116.88
7.2.130.0060.00916.47
7.2.120.0070.00416.73
7.2.110.0060.01216.82
7.2.100.0110.00716.82
7.2.90.0040.01516.83
7.2.80.0090.00916.43
7.2.70.0230.00616.58
7.2.60.0140.00816.82
7.2.50.0110.00716.75
7.2.40.0090.00616.72
7.2.30.0120.00316.64
7.2.20.0140.00716.85
7.2.10.0070.00716.84
7.2.00.0050.00818.07
7.1.250.0040.00715.52
7.1.200.0080.00415.94
7.1.100.0100.00017.66
7.1.70.0000.00717.14
7.1.60.0090.01619.82
7.1.50.0210.01234.91
7.1.00.0030.07722.46
7.0.200.0130.00016.85
7.0.140.0000.07722.12
7.0.60.0130.04020.03
7.0.50.0070.07017.91
7.0.40.0130.03720.20
7.0.30.0270.05020.15
7.0.20.0300.07320.23
7.0.10.0130.06020.09
7.0.00.0000.06320.23
5.6.280.0030.07320.83
5.6.210.0000.08320.48
5.6.200.0030.08318.18
5.6.190.0230.07320.54
5.6.180.0230.04320.53
5.6.170.0270.07020.61
5.6.160.0130.07020.59
5.6.150.0030.04018.18
5.6.140.0030.03718.18
5.6.130.0100.04718.15
5.6.120.0100.08321.04
5.6.110.0130.07721.00
5.6.100.0100.07021.00
5.6.90.0270.06020.98
5.6.80.0070.06020.41
5.6.70.0270.05020.44
5.5.350.0130.04320.34
5.5.340.0100.07318.04
5.5.330.0030.04720.32
5.5.320.0330.06720.43
5.5.310.0300.07020.39
5.5.300.0030.08317.99
5.5.290.0070.04717.93
5.5.280.0200.07020.81
5.5.270.0070.05720.65
5.5.260.0000.05720.98
5.5.250.0130.08020.59
5.5.240.0000.04720.20
5.4.450.1030.06719.76
5.4.440.0630.05319.49
5.4.430.0130.05319.43
5.4.420.0170.04719.65
5.4.410.0000.06319.07
5.4.400.0130.06318.54
5.4.390.0100.05318.59
5.4.380.0270.05718.76
5.4.370.0200.04718.61
5.4.360.0030.06018.51
5.4.350.0230.04718.84
5.4.340.0200.04718.56
5.4.320.0070.05712.52
5.4.310.0050.03812.52
5.4.300.0080.03312.52
5.4.290.0090.03712.52
5.4.280.0090.03912.42
5.4.270.0100.04012.39
5.4.260.0060.05212.39
5.4.250.0070.05312.39
5.4.240.0100.04812.39
5.4.230.0070.03912.37
5.4.220.0050.03712.38
5.4.210.0080.03312.38
5.4.200.0090.03512.38
5.4.190.0050.03812.38
5.4.180.0060.03812.37
5.4.170.0080.03912.39
5.4.160.0040.03912.38
5.4.150.0090.03712.38
5.4.140.0150.05412.06
5.4.130.0090.04412.05
5.4.120.0060.03612.00
5.4.110.0050.03712.00
5.4.100.0050.04012.00
5.4.90.0080.03512.00
5.4.80.0040.03912.00
5.4.70.0030.03812.00
5.4.60.0090.05212.00
5.4.50.0040.05212.00
5.4.40.0100.04511.98
5.4.30.0080.06611.98
5.4.20.0140.05411.98
5.4.10.0110.04311.98
5.4.00.0090.04911.47
5.3.290.0040.04812.80
5.3.280.0100.05212.71
5.3.270.0140.05412.73
5.3.260.0170.05012.72
5.3.250.0080.04812.72
5.3.240.0010.04212.72
5.3.230.0060.03712.71
5.3.220.0030.04212.68
5.3.210.0090.03712.68
5.3.200.0110.03212.68
5.3.190.0060.03912.68
5.3.180.0060.04412.67
5.3.170.0120.04712.67
5.3.160.0060.04412.67
5.3.150.0070.04312.67
5.3.140.0070.05312.66
5.3.130.0090.05212.66
5.3.120.0090.04112.66
5.3.110.0090.03812.66
5.3.100.0090.03612.12
5.3.90.0050.03912.09
5.3.80.0060.03812.07
5.3.70.0060.04012.08
5.3.60.0060.04012.06
5.3.50.0050.03912.00
5.3.40.0070.03712.00
5.3.30.0060.03711.98
5.3.20.0070.04311.75
5.3.10.0040.03911.72
5.3.00.0060.03711.70
5.2.170.0070.0339.22
5.2.160.0040.0329.22
5.2.150.0060.0319.21
5.2.140.0080.0289.21
5.2.130.0020.0339.18
5.2.120.0070.0289.18
5.2.110.0050.0399.17
5.2.100.0060.0369.18
5.2.90.0060.0389.18
5.2.80.0080.0419.18
5.2.70.0060.0359.17
5.2.60.0060.0309.12
5.2.50.0050.0329.10
5.2.40.0060.0279.07
5.2.30.0060.0299.04
5.2.20.0050.0299.04
5.2.10.0050.0288.97
5.2.00.0050.0318.82
5.1.60.0040.0258.11
5.1.50.0030.0268.11
5.1.40.0030.0268.10
5.1.30.0070.0248.44
5.1.20.0040.0278.46
5.1.10.0040.0278.19
5.1.00.0070.0248.18
5.0.50.0020.0246.67
5.0.40.0030.0216.53
5.0.30.0030.0336.34
5.0.20.0050.0186.31
5.0.10.0060.0186.29
5.0.00.0060.0296.28
4.4.90.0040.0144.78
4.4.80.0020.0164.75
4.4.70.0010.0184.75
4.4.60.0030.0154.75
4.4.50.0020.0174.77
4.4.40.0020.0274.71
4.4.30.0040.0214.76
4.4.20.0060.0214.84
4.4.10.0030.0214.84
4.4.00.0020.0334.76
4.3.110.0040.0214.67
4.3.100.0030.0164.66
4.3.90.0010.0204.63
4.3.80.0010.0284.58
4.3.70.0020.0164.63
4.3.60.0020.0164.63
4.3.50.0020.0174.63
4.3.40.0020.0264.54
4.3.30.0040.0153.35
4.3.20.0030.0163.34
4.3.10.0030.0153.30
4.3.00.0000.01313.28

preferences:
43.79 ms | 401 KiB | 5 Q