3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_number($n) { // first strip any formatting; $n = (0+str_replace(",","",$n)); // is this a number? if(!is_numeric($n)) return false; // now filter it; if($n>1000000000000) return round(($n/1000000000000),1).'T'; else if($n>1000000000) return round(($n/1000000000),1).'G'; else if($n>1000000) return round(($n/1000000),1).'M'; else if($n>1000) return round(($n/1000),1).'K'; return number_format($n); } echo count_number("2,000");

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.0030.01316.63
8.3.50.0130.00522.11
8.3.40.0170.00318.93
8.3.30.0080.00818.54
8.3.20.0000.00820.27
8.3.10.0030.00523.65
8.3.00.0110.00421.73
8.2.180.0100.01016.38
8.2.170.0190.00422.96
8.2.160.0140.00722.20
8.2.150.0110.01124.18
8.2.140.0070.00724.66
8.2.130.0040.00420.79
8.2.120.0040.00426.35
8.2.110.0100.00719.30
8.2.100.0110.00017.92
8.2.90.0040.00419.08
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0040.00417.80
8.2.50.0040.00418.09
8.2.40.0040.00422.26
8.2.30.0040.00419.49
8.2.20.0030.00517.73
8.2.10.0040.00417.97
8.2.00.0000.00718.06
8.1.280.0080.00825.92
8.1.270.0080.00021.91
8.1.260.0090.00328.09
8.1.250.0040.00428.09
8.1.240.0030.00622.27
8.1.230.0060.00617.83
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0120.00017.13
8.1.190.0000.00817.13
8.1.180.0050.00318.10
8.1.170.0000.00918.74
8.1.160.0070.00020.70
8.1.150.0040.00420.71
8.1.140.0040.00419.49
8.1.130.0030.00317.73
8.1.120.0050.00317.50
8.1.110.0050.00317.36
8.1.100.0040.00417.45
8.1.90.0060.00317.36
8.1.80.0040.00417.35
8.1.70.0030.00317.45
8.1.60.0000.00817.55
8.1.50.0030.00517.51
8.1.40.0080.00017.34
8.1.30.0050.00317.65
8.1.20.0040.00417.59
8.1.10.0030.00517.50
8.1.00.0040.00417.43
8.0.300.0030.00618.77
8.0.290.0040.00716.88
8.0.280.0030.00318.35
8.0.270.0070.00017.28
8.0.260.0040.00417.29
8.0.250.0000.00617.04
8.0.240.0000.00616.88
8.0.230.0030.00316.97
8.0.220.0060.00316.96
8.0.210.0000.00616.96
8.0.200.0000.00617.05
8.0.190.0020.00517.00
8.0.180.0000.00816.98
8.0.170.0000.00817.01
8.0.160.0000.00816.94
8.0.150.0040.00416.85
8.0.140.0000.00716.80
8.0.130.0000.00613.33
8.0.120.0080.00016.88
8.0.110.0000.00716.94
8.0.100.0070.00016.95
8.0.90.0000.00816.77
8.0.80.0100.00616.93
8.0.70.0030.00317.01
8.0.60.0000.00716.75
8.0.50.0040.00416.94
8.0.30.0180.01517.16
8.0.20.0100.01017.40
8.0.10.0030.00517.17
8.0.00.0090.00816.78
7.4.330.0020.00216.76
7.4.320.0000.00616.36
7.4.300.0030.00316.51
7.4.290.0000.00716.49
7.4.280.0050.00516.58
7.4.270.0000.00716.52
7.4.260.0040.00716.53
7.4.250.0030.00616.47
7.4.240.0030.00316.64
7.4.230.0000.00816.57
7.4.220.0120.00616.39
7.4.210.0070.01216.47
7.4.200.0000.00716.57
7.4.160.0090.00616.28
7.4.150.0060.01217.40
7.4.140.0210.00817.86
7.4.130.0090.01116.49
7.4.120.0110.00516.47
7.4.110.0060.01016.43
7.4.100.0100.00616.47
7.4.90.0130.00416.54
7.4.80.0140.00519.39
7.4.70.0100.00716.46
7.4.60.0000.01616.63
7.4.50.0000.01116.39
7.4.40.0060.01516.58
7.4.30.0090.00916.49
7.4.10.0150.01516.41
7.4.00.0100.00815.65
7.3.330.0060.00013.21
7.3.320.0050.00013.36
7.3.310.0000.00716.32
7.3.300.0050.00216.23
7.3.290.0040.00416.37
7.3.280.0130.00516.36
7.3.270.0110.00817.40
7.3.260.0030.01416.66
7.3.250.0110.00816.37
7.3.240.0080.00816.46
7.3.230.0110.00616.39
7.3.210.0100.00616.47
7.3.200.0230.00019.39
7.3.190.0100.00616.57
7.3.180.0100.00716.54
7.3.170.0040.01516.57
7.3.160.0070.01016.29
7.3.130.0190.00916.22
7.3.120.0180.00816.38
7.3.110.0150.01116.41
7.3.100.0210.00216.42
7.3.90.0210.00816.24
7.3.80.0060.01916.55
7.3.70.0150.01116.44
7.3.60.0200.01016.16
7.3.50.0180.00416.32
7.3.40.0140.01116.36
7.3.30.0230.00516.32
7.3.20.0150.00818.26
7.3.10.0190.00618.16
7.3.00.0210.00918.15
7.2.330.0100.01016.71
7.2.320.0100.00616.37
7.2.310.0130.00316.30
7.2.300.0100.00616.28
7.2.290.0100.01016.73
7.2.260.0210.00616.66
7.2.250.0090.01716.68
7.2.240.0130.01716.44
7.2.230.0140.01616.50
7.2.220.0150.01516.48
7.2.210.0190.01016.65
7.2.200.0150.01616.30
7.2.190.0230.00816.41
7.2.180.0140.01416.56
7.2.170.0220.00916.41
7.2.160.0150.01116.50
7.2.150.0200.00918.46
7.2.140.0120.01218.20
7.2.130.0290.00018.22
7.2.120.0120.01918.47
7.2.110.0120.01918.36
7.2.100.0190.01118.39
7.2.90.0180.00613.63
7.2.80.0140.01818.32
7.2.70.0130.01618.24
7.2.60.0210.00918.45
7.2.50.0270.00718.28
7.2.40.0200.01018.45
7.2.30.0210.00918.33
7.2.20.0200.01218.32
7.2.10.0220.00818.24
7.2.00.0060.01218.60
7.1.330.0130.01317.38
7.1.320.0180.01017.42
7.1.310.0150.00917.56
7.1.300.0110.01517.23
7.1.290.0160.01117.39
7.1.280.0170.01317.27
7.1.270.0160.00817.46
7.1.260.0130.01117.18
7.1.250.0100.01517.45
7.1.240.0110.01217.19
7.1.230.0170.01117.45
7.1.220.0160.00917.44
7.1.210.0130.01317.16
7.1.200.0170.01017.25
7.1.190.0120.02017.21
7.1.180.0190.01117.34
7.1.170.0100.01417.32
7.1.160.0190.01117.29
7.1.150.0180.00617.42
7.1.140.0260.00717.38
7.1.130.0120.01217.23
7.1.120.0160.00817.16
7.1.110.0100.00917.19
7.1.100.0030.01017.93
7.1.90.0070.01117.24
7.1.80.0040.01417.32
7.1.70.0040.00917.27
7.1.60.0080.01218.32
7.1.50.0140.00716.98
7.1.40.0080.00617.14
7.1.30.0070.00717.36
7.1.20.0040.01117.37
7.1.10.0070.01117.46
7.1.00.0080.04119.87
7.0.330.0150.00916.79
7.0.320.0110.01817.01
7.0.310.0110.01516.75
7.0.300.0120.01217.12
7.0.290.0140.01117.20
7.0.280.0200.00717.13
7.0.270.0190.00716.89
7.0.260.0150.00816.96
7.0.250.0040.01117.03
7.0.240.0110.00717.14
7.0.230.0130.00317.27
7.0.220.0050.00517.01
7.0.210.0120.00617.11
7.0.200.0080.00616.89
7.0.190.0030.01017.08
7.0.180.0070.01017.04
7.0.170.0110.00717.05
7.0.160.0060.00917.12
7.0.150.0130.00316.87
7.0.140.0030.01217.01
7.0.130.0090.00616.89
7.0.120.0030.01316.92
7.0.110.0090.00416.89
7.0.100.0200.03918.44
7.0.90.0990.04518.41
7.0.80.0100.03818.40
7.0.70.0120.03418.46
7.0.60.0300.03918.51
7.0.50.0140.04118.60
7.0.40.0130.02917.47
7.0.30.0110.04517.61
7.0.20.0110.05217.49
7.0.10.0150.04717.60
7.0.00.0120.03617.47
5.6.400.0150.01316.14
5.6.390.0190.01016.08
5.6.380.0170.00715.82
5.6.370.0120.01215.91
5.6.360.0120.00816.01
5.6.350.0180.00715.57
5.6.340.0220.00915.95
5.6.330.0250.00015.92
5.6.320.0100.00715.89
5.6.310.0030.01015.58
5.6.300.0000.01815.82
5.6.290.0060.00916.02
5.6.280.0050.03018.32
5.6.270.0040.01215.94
5.6.260.0040.01515.70
5.6.250.0080.04018.25
5.6.240.0140.04318.30
5.6.230.0150.04118.24
5.6.220.0140.02818.23
5.6.210.0070.04718.33
5.6.200.0190.03518.31
5.6.190.0110.04618.34
5.6.180.0130.03818.50
5.6.170.0170.02318.45
5.6.160.0120.04518.33
5.6.150.0170.03218.40
5.6.140.0110.04018.44
5.6.130.0140.04718.34
5.6.120.0140.05518.64
5.6.110.0100.04318.38
5.6.100.0110.03318.38
5.6.90.0180.03718.34
5.6.80.0060.03318.20
5.6.70.0110.04618.11
5.6.60.0090.03618.12
5.6.50.0150.03918.16
5.6.40.0140.04218.08
5.6.30.0090.04518.10
5.6.20.0150.03717.99
5.6.10.0160.04018.16
5.6.00.0130.04018.07
5.5.380.0100.03018.00
5.5.370.0070.03918.14
5.5.360.0130.04617.98
5.5.350.0120.03818.04
5.5.340.0170.04018.32
5.5.330.0120.04918.23
5.5.320.0170.03218.21
5.5.310.0090.05018.27
5.5.300.0090.04718.31
5.5.290.0110.04218.36
5.5.280.0120.04918.38
5.5.270.0200.03818.34
5.5.260.0140.04618.31
5.5.250.0100.02718.14
5.5.240.0110.03917.99
5.5.230.0150.03717.99
5.5.220.0140.04218.01
5.5.210.0170.03918.01
5.5.200.0140.04318.05
5.5.190.0050.04717.99
5.5.180.0090.04917.99
5.5.170.0170.00915.77
5.5.160.0100.04118.00
5.5.150.0070.03217.88
5.5.140.0080.03017.89
5.5.130.0060.02917.98
5.5.120.0180.03817.98
5.5.110.0160.04018.01
5.5.100.0150.03117.90
5.5.90.0190.04017.95
5.5.80.0080.04717.92
5.5.70.0100.03717.89
5.5.60.0090.04517.86
5.5.50.0110.03117.95
5.5.40.0150.04117.92
5.5.30.0130.03817.96
5.5.20.0120.03117.94
5.5.10.0140.03716.76
5.5.00.0150.03217.88

preferences:
58.64 ms | 401 KiB | 5 Q