3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert($n) { $n = (0 + str_replace(",", "", $n)); if (!is_numeric($n)) return false; if ($n > 1000000000000) return round(($n / 1000000000000) , 1) . 'T'; else if ($n > 1000000000) return round(($n / 1000000000) , 1) . 'B'; else if ($n > 1000000) return round(($n / 1000000) , 1) . 'M'; else if ($n > 1000) return round(($n / 1000) , 1) . 'K'; return number_format($n); } $n = convert('35,578,926'); echo $n; // 35.5M

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.5.10.0110.00716.79
8.5.00.0130.01219.72
8.4.150.0010.00114.05
8.4.140.0100.01117.58
8.4.130.0120.00817.57
8.4.120.0110.01023.98
8.4.110.0100.00922.29
8.4.100.0140.00917.77
8.4.90.0080.00320.43
8.4.80.0120.00819.03
8.4.70.0110.01120.50
8.4.60.0110.00619.02
8.4.50.0110.00918.45
8.4.40.0070.00318.31
8.4.30.0100.01020.59
8.4.20.0070.01420.62
8.4.10.0130.00319.60
8.3.280.0080.01218.35
8.3.270.0110.00916.60
8.3.260.0080.01116.43
8.3.250.0050.00318.90
8.3.240.0120.00817.23
8.3.230.0110.00816.63
8.3.220.0090.00918.98
8.3.210.0040.00418.39
8.3.200.0050.00416.74
8.3.190.0070.00817.05
8.3.180.0110.00719.07
8.3.170.0040.00416.80
8.3.160.0040.01517.08
8.3.150.0130.00618.78
8.3.140.0000.00919.09
8.3.130.0040.00716.75
8.3.120.0110.00819.06
8.3.110.0120.00316.41
8.3.100.0040.00816.48
8.3.90.0120.00626.77
8.3.80.0060.00316.38
8.3.70.0140.00416.58
8.3.60.0160.00718.30
8.3.50.0140.00318.34
8.3.40.0040.01118.88
8.3.30.0000.01518.77
8.3.20.0090.00024.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.290.0150.00416.42
8.2.280.0110.00918.19
8.2.270.0110.00716.48
8.2.260.0050.00316.57
8.2.250.0000.01016.38
8.2.240.0080.00017.01
8.2.230.0030.00620.94
8.2.220.0030.00637.54
8.2.210.0110.00426.77
8.2.200.0000.00916.50
8.2.190.0070.00716.63
8.2.180.0040.01525.92
8.2.170.0040.01119.02
8.2.160.0120.00322.96
8.2.150.0080.01125.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0000.01020.98
8.2.100.0080.00418.16
8.2.90.0000.00819.20
8.2.80.0060.00317.97
8.2.70.0030.00617.75
8.2.60.0030.00617.93
8.2.50.0060.00318.07
8.2.40.0030.00619.95
8.2.30.0040.00418.11
8.2.20.0000.00818.18
8.2.10.0020.00519.31
8.2.00.0040.00419.21
8.1.330.0120.00616.18
8.1.320.0080.01216.02
8.1.310.0070.01115.96
8.1.300.0030.00618.06
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0070.00023.99
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0030.00621.25
8.1.230.0040.00717.96
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00418.78
8.1.160.0050.00318.90
8.1.150.0030.00518.95
8.1.140.0040.00419.07
8.1.130.0000.00620.32
8.1.120.0040.00417.42
8.1.110.0040.00417.47
8.1.100.0040.00417.53
8.1.90.0040.00417.51
8.1.80.0030.00617.50
8.1.70.0070.00317.32
8.1.60.0000.00717.63
8.1.50.0040.00417.61
8.1.40.0040.00417.57
8.1.30.0040.00417.62
8.1.20.0050.00317.60
8.1.10.0000.00817.47
8.1.00.0040.00417.54
8.0.300.0000.00818.77
8.0.290.0050.00316.75
8.0.280.0000.00718.43
8.0.270.0070.00018.13
8.0.260.0060.00018.67
8.0.250.0000.00717.03
8.0.240.0030.00317.08
8.0.230.0030.00317.13
8.0.220.0000.00716.89
8.0.210.0000.00717.02
8.0.200.0000.00816.95
8.0.190.0000.00716.93
8.0.180.0020.00517.03
8.0.170.0000.00817.03
8.0.160.0020.00516.98
8.0.150.0070.00016.88
8.0.140.0030.00516.92
8.0.130.0030.00313.39
8.0.120.0040.00416.95
8.0.110.0000.00717.06
8.0.100.0040.00417.02
8.0.90.0000.00716.88
8.0.80.0070.01017.00
8.0.70.0050.01016.94
8.0.60.0100.00616.97
8.0.50.0100.00716.96
8.0.30.0090.00716.95
8.0.20.0100.00717.14
8.0.10.0070.01117.04
8.0.00.0170.00317.14
7.4.330.0020.00215.55
7.4.320.0030.00616.61
7.4.300.0040.00416.67
7.4.290.0020.00516.58
7.4.280.0040.00416.64
7.4.270.0000.00716.65
7.4.260.0000.00513.33
7.4.250.0040.00416.51
7.4.240.0080.00016.60
7.4.230.0030.00616.36
7.4.220.0030.00316.73
7.4.210.0060.00816.60
7.4.200.0120.00516.63
7.4.190.0050.01216.60
7.4.180.0050.00916.74
7.4.160.0130.00216.64
7.4.150.0100.00516.57
7.4.140.0090.00716.42
7.4.130.0070.00716.48
7.4.120.0040.01216.48
7.4.110.0120.00516.62
7.4.100.0070.00916.60
7.4.90.0060.01216.45
7.4.80.0070.01016.50
7.4.70.0040.01316.61
7.4.60.0070.01116.47
7.4.50.0030.01416.31
7.4.40.0070.01016.37
7.4.30.0110.00616.65
7.4.20.0110.00616.38
7.4.10.0060.01116.66
7.4.00.0100.00416.56
7.3.330.0000.00716.45
7.3.320.0000.00713.28
7.3.310.0040.00416.41
7.3.300.0070.00016.41
7.3.290.0070.00916.38
7.3.280.0100.01016.36
7.3.270.0100.00716.51
7.3.260.0080.00816.36
7.3.250.0060.01016.44
7.3.240.0110.00616.37
7.3.230.0030.01416.42
7.3.220.0110.00916.38
7.3.210.0110.00716.36
7.3.200.0090.00716.33
7.3.190.0110.00516.35
7.3.180.0090.00716.34
7.3.170.0080.01016.37
7.3.160.0110.00616.30
7.3.150.0100.01016.33
7.3.140.0100.00616.34
7.3.130.0050.01016.41
7.3.120.0090.00616.38
7.3.110.0060.00916.28
7.3.100.0080.00616.24
7.3.90.0050.01016.62
7.3.80.0090.00516.35
7.3.70.0070.00816.42
7.3.60.0060.00816.49
7.3.50.0110.00516.51
7.3.40.0080.00816.53
7.3.30.0070.00916.50
7.3.20.0130.00616.49
7.3.10.0050.00916.52
7.3.00.0100.01016.45

preferences:
35.38 ms | 403 KiB | 5 Q