3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('nice_number')) { 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(300000000);

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.0180.00418.23
8.3.50.0100.00722.11
8.3.40.0150.00618.67
8.3.30.0140.00019.05
8.3.20.0040.00420.16
8.3.10.0080.00022.00
8.3.00.0000.00822.43
8.2.180.0170.00316.63
8.2.170.0090.00622.96
8.2.160.0030.01020.93
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00319.48
8.2.110.0090.00022.14
8.2.100.0040.00717.91
8.2.90.0080.00019.17
8.2.80.0050.00317.97
8.2.70.0040.00417.75
8.2.60.0080.00018.16
8.2.50.0030.00618.07
8.2.40.0000.00718.28
8.2.30.0040.00418.19
8.2.20.0040.00417.80
8.2.10.0080.00019.61
8.2.00.0040.00417.82
8.1.280.0100.01025.92
8.1.270.0040.00421.91
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0070.01023.79
8.1.230.0030.00719.10
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0000.00917.00
8.1.190.0030.00517.53
8.1.180.0000.00818.10
8.1.170.0050.00318.50
8.1.160.0000.00722.04
8.1.150.0000.00818.65
8.1.140.0040.00417.45
8.1.130.0030.00317.80
8.1.120.0050.00317.52
8.1.110.0070.00017.41
8.1.100.0070.00017.52
8.1.90.0000.00717.31
8.1.80.0000.00717.45
8.1.70.0060.00317.45
8.1.60.0030.00617.61
8.1.50.0050.00317.50
8.1.40.0000.00817.48
8.1.30.0040.00417.58
8.1.20.0040.00417.67
8.1.10.0000.00717.54
8.1.00.0060.00317.47
8.0.300.0040.00418.77
8.0.290.0070.00017.16
8.0.280.0050.00318.45
8.0.270.0070.00017.33
8.0.260.0030.00316.81
8.0.250.0000.00717.03
8.0.240.0000.00816.89
8.0.230.0000.00716.88
8.0.220.0040.00416.89
8.0.210.0030.00516.94
8.0.200.0000.00917.01
8.0.190.0040.00416.99
8.0.180.0000.00817.00
8.0.170.0040.00417.08
8.0.160.0000.00716.82
8.0.150.0030.00516.83
8.0.140.0040.00416.93
8.0.130.0000.00813.27
8.0.120.0030.00516.83
8.0.110.0000.00716.95
8.0.100.0000.00716.94
8.0.90.0070.00016.95
8.0.80.0120.00316.89
8.0.70.0040.00416.78
8.0.60.0040.00416.93
8.0.50.0030.00516.78
8.0.30.0110.00717.02
8.0.20.0050.01517.40
8.0.10.0050.00317.00
8.0.00.0110.00616.79
7.4.330.0000.00515.05
7.4.320.0000.00616.60
7.4.300.0000.00616.43
7.4.290.0030.00316.51
7.4.280.0000.00616.54
7.4.270.0020.00516.53
7.4.260.0000.01116.59
7.4.250.0080.00016.62
7.4.240.0020.00616.55
7.4.230.0070.00016.42
7.4.220.0130.01316.54
7.4.210.0090.00716.61
7.4.200.0000.00716.52
7.4.190.0050.00316.74
7.4.160.0180.00016.45
7.4.150.0090.00917.40
7.4.140.0040.01417.86
7.4.130.0070.01316.64
7.4.120.0080.01016.68
7.4.110.0100.00716.44
7.4.100.0140.00516.53
7.4.90.0090.00916.63
7.4.80.0160.00019.39
7.4.70.0170.00016.30
7.4.60.0060.01516.52
7.4.50.0030.00616.28
7.4.40.0120.00322.77
7.4.30.0060.01016.44
7.4.00.0040.00715.14
7.3.330.0030.00313.38
7.3.320.0000.00513.33
7.3.310.0070.00016.24
7.3.300.0030.00316.34
7.3.290.0110.00416.39
7.3.280.0090.00816.38
7.3.270.0110.00617.40
7.3.260.0070.01116.57
7.3.250.0150.00516.37
7.3.240.0090.00816.47
7.3.230.0040.01416.59
7.3.210.0080.00816.57
7.3.200.0060.01416.46
7.3.190.0090.01616.66
7.3.180.0030.01216.46
7.3.170.0140.00316.49
7.3.160.0080.00816.65
7.3.120.0090.00614.77
7.2.330.0110.00616.42
7.2.320.0140.00416.65
7.2.310.0170.00316.31
7.2.300.0070.01116.72
7.2.290.0130.00316.80
7.1.70.0070.00017.34
7.1.60.0150.00619.82
7.1.50.0030.01317.09
7.1.00.0030.07722.29
7.0.200.0100.00316.79
7.0.140.0070.07021.98
7.0.60.0070.07720.11
7.0.50.0070.03717.92
7.0.40.0100.08320.12
7.0.30.0270.08020.26
7.0.20.0470.06720.26
7.0.10.0070.08720.16
7.0.00.0070.04720.15
5.6.280.0000.07721.08
5.6.210.0100.06720.68
5.6.200.0100.07718.30
5.6.190.0100.04720.57
5.6.180.0100.04320.47
5.6.170.0170.04020.52
5.6.160.0000.04320.62
5.6.150.0000.04718.16
5.6.140.0030.05318.17
5.6.130.0070.08318.22
5.6.120.0200.03721.00
5.6.110.0030.06021.02
5.6.100.0070.04021.12
5.6.90.0070.07321.04
5.6.80.0070.04720.28
5.5.350.0030.08320.39
5.5.340.0030.04018.02
5.5.330.0100.04020.37
5.5.320.0100.04720.27
5.5.310.0300.04320.34
5.5.300.0030.07717.98
5.5.290.0100.07317.97
5.5.280.0100.03720.78
5.5.270.0100.03720.64
5.5.260.0070.08020.90
5.5.250.0170.07320.51
5.5.240.0030.08320.38
5.4.450.0500.03719.32
5.4.440.1100.06719.32
5.4.430.1470.00019.66
5.4.420.1370.00019.55
5.4.410.0070.05719.07
5.4.400.0170.06018.77
5.4.390.0170.05018.77
5.4.380.0200.05718.73
5.4.370.0130.05018.56
5.4.360.0130.05318.59
5.4.350.0270.04318.76
5.4.340.0200.04718.69
5.4.320.0080.03512.51
5.4.310.0070.03612.51
5.4.300.0080.03612.51
5.4.290.0080.03912.50
5.4.280.0070.03612.40
5.4.270.0050.03612.38
5.4.260.0080.03812.38
5.4.250.0030.04412.38
5.4.240.0110.03112.38
5.4.230.0090.04912.37
5.4.220.0060.04512.37
5.4.210.0060.03512.37
5.4.200.0080.03712.37
5.4.190.0080.03612.36
5.4.180.0070.03912.36
5.4.170.0090.05012.38
5.4.160.0080.03812.36
5.4.150.0130.03512.37
5.4.140.0050.05312.05
5.4.130.0060.04812.04
5.4.120.0080.04911.99
5.4.110.0110.04811.98
5.4.100.0140.04011.99
5.4.90.0050.04411.99
5.4.80.0100.04711.99
5.4.70.0070.04611.98
5.4.60.0050.04311.98
5.4.50.0070.03711.99
5.4.40.0090.03211.98
5.4.30.0040.04411.97
5.4.20.0080.04011.97
5.4.10.0050.03711.97
5.4.00.0050.04711.46
5.3.290.0060.04312.80
5.3.280.0050.04412.71
5.3.270.0070.04812.72
5.3.260.0080.05412.72
5.3.250.0090.04512.72
5.3.240.0130.04912.71
5.3.230.0060.03812.71
5.3.220.0070.05712.68
5.3.210.0050.05212.68
5.3.200.0050.03812.68
5.3.190.0070.03912.68
5.3.180.0100.03512.68
5.3.170.0070.03812.67
5.3.160.0080.04412.67
5.3.150.0070.04412.67
5.3.140.0060.05112.66
5.3.130.0110.05012.66
5.3.120.0110.05012.66
5.3.110.0130.05312.66
5.3.100.0090.04912.12
5.3.90.0070.05112.09
5.3.80.0080.04112.07
5.3.70.0080.03412.07
5.3.60.0040.04012.06
5.3.50.0030.04012.01
5.3.40.0080.04312.01
5.3.30.0050.03611.98
5.3.20.0060.03611.75
5.3.10.0060.03611.71
5.3.00.0060.03711.70
5.2.170.0040.0389.20
5.2.160.0060.0309.20
5.2.150.0080.0299.20
5.2.140.0040.0329.20
5.2.130.0040.0319.16
5.2.120.0080.0269.16
5.2.110.0050.0299.16
5.2.100.0070.0279.17
5.2.90.0170.0559.17
5.2.80.0040.0489.16
5.2.70.0040.0319.16
5.2.60.0080.0279.11
5.2.50.0060.0299.08
5.2.40.0040.0309.05
5.2.30.0040.0319.03
5.2.20.0050.0469.03
5.2.10.0070.0458.96
5.2.00.0080.0408.81
5.1.60.0060.0248.09
5.1.50.0120.0458.10
5.1.40.0090.0348.08
5.1.30.0150.0668.43
5.1.20.0110.0668.45
5.1.10.0040.0348.17
5.1.00.0100.0288.17
5.0.50.0090.0306.66
5.0.40.0060.0256.51
5.0.30.0040.0396.33
5.0.20.0030.0266.30
5.0.10.0030.0296.27
5.0.00.0030.0386.27
4.4.90.0030.0184.78
4.4.80.0020.0224.76
4.4.70.0020.0234.75
4.4.60.0030.0194.75
4.4.50.0040.0234.77
4.4.40.0050.0244.71
4.4.30.0050.0144.75
4.4.20.0030.0164.84
4.4.10.0030.0164.85
4.4.00.0040.0284.75
4.3.110.0050.0144.67
4.3.100.0030.0174.67
4.3.90.0010.0194.64
4.3.80.0020.0254.58
4.3.70.0030.0144.63
4.3.60.0020.0214.63
4.3.50.0020.0194.63
4.3.40.0040.0254.53
4.3.30.0020.0163.33
4.3.20.0010.0183.31
4.3.10.0000.0213.28
4.3.00.0070.01313.27

preferences:
43.18 ms | 401 KiB | 5 Q