3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fNumString(string $numberString, string $decimalPoint = '.', string $thousandsSeparator = ','): string { [$integerPart, $decimalPart] = array_pad(explode('.', $numberString, 2), 2, null); $integerPart = strrev(preg_replace('/\d{3}(?=\d)/', '\0' . $thousandsSeparator, strrev($integerPart))); return $integerPart . ($decimalPart ? $decimalPoint . $decimalPart : ''); } echo fNumString('1000.382'), PHP_EOL; echo fNumString('99.01'), PHP_EOL; echo fNumString('1900000'), PHP_EOL; echo fNumString('19000000000000000000123.12399999999198');

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.0030.00518.95
8.5.00.0130.00920.11
8.4.150.0030.00014.05
8.4.140.0170.00417.99
8.4.130.0130.00818.82
8.4.120.0120.00724.23
8.4.110.0040.00618.68
8.4.100.0060.00518.73
8.4.90.0090.00820.70
8.4.80.0050.00718.93
8.4.70.0140.00718.21
8.4.60.0130.00718.76
8.4.50.0030.00618.86
8.4.40.0130.00619.41
8.4.30.0040.00420.27
8.4.20.0050.00317.87
8.4.10.0060.00317.98
8.3.280.0120.00818.60
8.3.270.0130.00616.75
8.3.260.0040.00416.79
8.3.250.0110.00619.02
8.3.240.0120.00719.03
8.3.230.0080.01116.65
8.3.220.0070.00118.82
8.3.210.0110.00716.71
8.3.200.0060.00316.88
8.3.190.0070.01120.43
8.3.180.0090.00817.23
8.3.170.0090.00918.83
8.3.160.0180.00016.76
8.3.150.0120.00620.61
8.3.140.0030.00516.72
8.3.130.0040.00418.28
8.3.120.0060.00318.99
8.3.110.0080.00020.94
8.3.100.0030.00618.42
8.3.90.0080.00026.77
8.3.80.0050.00516.50
8.3.70.0150.00016.63
8.3.60.0030.01318.55
8.3.50.0120.00523.77
8.3.40.0070.00718.83
8.3.30.0140.00018.79
8.3.20.0040.00421.95
8.3.10.0000.00822.10
8.3.00.0040.00423.72
8.2.290.0120.00620.30
8.2.280.0100.00618.57
8.2.270.0110.00717.31
8.2.260.0000.00816.88
8.2.250.0040.00418.93
8.2.240.0070.01319.07
8.2.230.0070.00722.58
8.2.220.0000.00924.06
8.2.210.0110.00726.77
8.2.200.0040.00418.79
8.2.190.0060.00918.79
8.2.180.0120.00918.28
8.2.170.0110.00722.96
8.2.160.0090.00620.44
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00426.16
8.2.110.0030.00620.24
8.2.100.0040.00818.03
8.2.90.0030.00617.75
8.2.80.0000.00819.04
8.2.70.0030.00617.93
8.2.60.0090.00018.22
8.2.50.0040.00418.10
8.2.40.0000.00819.52
8.2.30.0000.00719.31
8.2.20.0090.00018.23
8.2.10.0000.00719.41
8.2.00.0040.00419.39
8.1.330.0100.00822.27
8.1.320.0040.00320.16
8.1.310.0160.00316.88
8.1.300.0030.01216.24
8.1.290.0080.00030.84
8.1.280.0000.01525.92
8.1.270.0050.00522.15
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0090.01323.83
8.1.230.0000.01117.71
8.1.220.0000.00817.79
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0060.00317.35
8.1.180.0030.00619.04
8.1.170.0030.00518.78
8.1.160.0040.00418.91
8.1.150.0040.00418.95
8.1.140.0050.00220.80
8.1.130.0000.00720.22
8.1.120.0000.00717.48
8.1.110.0000.00717.45
8.1.100.0030.00617.57
8.1.90.0030.00517.59
8.1.80.0070.00017.55
8.1.70.0070.00017.57
8.1.60.0050.00317.75
8.1.50.0080.00017.71
8.1.40.0040.00417.69
8.1.30.0000.00817.73
8.1.20.0000.00817.89
8.1.10.0050.00217.77
8.1.00.0050.00317.55
8.0.300.0060.00318.99
8.0.290.0000.00916.75
8.0.280.0030.00318.50
8.0.270.0040.00416.97
8.0.260.0030.00320.00
8.0.250.0070.00017.06
8.0.240.0040.00417.02
8.0.230.0030.00317.02
8.0.220.0000.00717.03
8.0.210.0000.00817.03
8.0.200.0000.00717.19
8.0.190.0040.00417.13
8.0.180.0000.00717.13
8.0.170.0030.00617.04
8.0.160.0030.00516.98
8.0.150.0040.00416.89
8.0.140.0070.00017.04
8.0.130.0050.00013.46
8.0.120.0040.00417.07
8.0.110.0040.00416.93
8.0.100.0040.00417.12
8.0.90.0090.00017.06
8.0.80.0080.00917.00
8.0.70.0050.00217.10
8.0.60.0000.00717.01
8.0.50.0050.00317.18
8.0.30.0030.01417.13
8.0.20.0100.01017.30
8.0.10.0070.00017.06
8.0.00.0080.01216.91
7.4.330.0020.00216.80
7.4.320.0000.00616.69
7.4.300.0070.00016.80
7.4.290.0030.00316.85
7.4.280.0040.00416.81
7.4.270.0000.00816.85
7.4.260.0000.00513.63
7.4.250.0000.00716.82
7.4.240.0030.00416.77
7.4.230.0030.00316.66
7.4.220.0000.00716.67
7.4.210.0080.01016.73
7.4.200.0000.00716.74
7.4.130.0100.01016.89
7.4.120.0090.00916.97
7.4.110.0070.01016.75
7.4.100.0070.01316.67
7.4.90.0090.00916.58
7.4.80.0110.01219.39
7.4.70.0120.00916.75
7.4.60.0070.01016.84
7.4.50.0100.00316.52
7.4.40.0110.00516.83
7.4.20.0110.00516.63
7.4.10.0060.00916.75
7.4.00.0030.01316.70
7.3.330.0040.00416.59
7.3.320.0030.00313.48
7.3.310.0030.00316.41
7.3.300.0040.00416.55
7.3.290.0070.00916.50
7.3.260.0110.00616.56
7.3.240.0130.00716.79
7.3.230.0110.00716.67
7.3.210.0160.00816.61
7.3.200.0100.00716.87
7.3.190.0090.00816.70
7.3.180.0100.00716.89
7.3.170.0150.00616.75
7.3.160.0030.01316.63
7.3.130.0000.01616.52
7.3.120.0100.00616.52
7.3.110.0080.00716.40
7.3.100.0120.00316.43
7.3.90.0060.01016.70
7.3.80.0110.00516.70
7.3.70.0060.00916.50
7.3.60.0120.00616.53
7.3.50.0080.00816.61
7.3.40.0060.01216.54
7.3.30.0060.00916.56
7.3.20.0080.00816.63
7.3.10.0090.01216.55
7.3.00.0070.01016.43
7.2.330.0070.01016.89
7.2.320.0090.01516.91
7.2.310.0090.00916.92
7.2.300.0170.00716.81
7.2.290.0060.00916.88
7.2.260.0110.00516.66
7.2.250.0110.00616.89
7.2.240.0060.00916.92
7.2.230.0060.00916.63
7.2.220.0100.00716.68
7.2.210.0100.00716.72
7.2.200.0030.01216.77
7.2.190.0110.00816.77
7.2.180.0130.00316.90
7.2.170.0070.01016.66
7.2.160.0030.01316.82
7.2.150.0140.00316.76
7.2.140.0100.00616.81
7.2.130.0050.01116.87
7.2.120.0140.00516.91
7.2.110.0040.01816.71
7.2.100.0060.01216.83
7.2.90.0110.00716.68
7.2.80.0090.00916.81
7.2.70.0110.00616.84
7.2.60.0130.01016.70
7.2.50.0030.01416.73
7.2.40.0070.01716.79
7.2.30.0150.00916.83
7.2.20.0070.01717.02
7.2.10.0090.00916.76
7.2.00.0130.00316.69

preferences:
39.93 ms | 403 KiB | 5 Q