3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Comma Formatted: ' . nyx_number_format('1.233.332,34', 'comma') . ' - '; echo 'Dot Formatted: ' . nyx_number_format('1,233,332.34', 'dot'); function nyx_number_format($number, $separator = 'dot') { // Default setting $thousand_separator = ','; $decimal_separator = '.'; if ($separator == 'comma') { $thousand_separator = '.'; $decimal_separator = ','; } // Remove the thousand separator $number = str_replace($thousand_separator, '', $number); // Make sure the Decimal separator is correct $number = str_replace($decimal_separator, '.', $number); if ($separator == 'comma') { return number_format($number, 2, ',', '.'); } return number_format($number, 2, '.', ','); }

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.0060.00918.39
8.3.50.0100.00922.05
8.3.40.0110.00318.83
8.3.30.0040.01118.67
8.3.20.0050.00318.78
8.3.10.0090.00021.08
8.3.00.0040.00422.03
8.2.180.0120.00616.50
8.2.170.0060.01122.96
8.2.160.0120.00320.55
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0000.00826.16
8.2.120.0080.00021.05
8.2.110.0070.00320.60
8.2.100.0070.00417.84
8.2.90.0000.00719.22
8.2.80.0080.00017.97
8.2.70.0040.00417.75
8.2.60.0000.00818.16
8.2.50.0000.00818.07
8.2.40.0050.00218.22
8.2.30.0080.00021.42
8.2.20.0000.00717.73
8.2.10.0050.00317.88
8.2.00.0040.00417.82
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00622.44
8.1.230.0040.00721.03
8.1.220.0030.00718.77
8.1.210.0000.00818.97
8.1.200.0070.00317.23
8.1.190.0020.00517.54
8.1.180.0040.00418.10
8.1.170.0000.00918.78
8.1.160.0050.00218.91
8.1.150.0000.00718.63
8.1.140.0080.00017.45
8.1.130.0050.00317.96
8.1.120.0020.00517.59
8.1.110.0000.00717.41
8.1.100.0030.00517.43
8.1.90.0000.00717.47
8.1.80.0050.00317.47
8.1.70.0060.00317.48
8.1.60.0000.00817.65
8.1.50.0040.00417.56
8.1.40.0060.00317.50
8.1.30.0000.00817.69
8.1.20.0040.00417.71
8.1.10.0050.00317.52
8.1.00.0030.00617.41
8.0.300.0000.00720.14
8.0.290.0000.00817.18
8.0.280.0030.00318.58
8.0.270.0030.00317.20
8.0.260.0000.00618.44
8.0.250.0070.00017.02
8.0.240.0090.00017.01
8.0.230.0030.00417.02
8.0.220.0000.00716.96
8.0.210.0040.00416.90
8.0.200.0030.00616.92
8.0.190.0050.00317.03
8.0.180.0040.00416.98
8.0.170.0050.00316.87
8.0.160.0050.00216.86
8.0.150.0040.00416.95
8.0.140.0070.00016.83
8.0.130.0000.00613.48
8.0.120.0070.00016.95
8.0.110.0040.00416.93
8.0.100.0070.00016.78
8.0.90.0040.00416.90
8.0.80.0130.00217.00
8.0.70.0040.00416.84
8.0.60.0040.00416.85
8.0.50.0000.00816.97
8.0.30.0090.00917.22
8.0.20.0120.00617.40
8.0.10.0000.00716.89
8.0.00.0140.00416.81
7.4.330.0000.00514.80
7.4.320.0030.00316.74
7.4.300.0030.00316.65
7.4.290.0030.00316.70
7.4.280.0000.00616.55
7.4.270.0040.00416.63
7.4.260.0000.00613.34
7.4.250.0030.00616.68
7.4.240.0060.00316.68
7.4.230.0030.00516.70
7.4.220.0110.00716.57
7.4.210.0070.00716.60
7.4.200.0000.00716.51
7.4.190.0090.00016.79
7.4.160.0160.00016.58
7.4.150.0030.01417.40
7.4.140.0090.00917.86
7.4.130.0130.00616.56
7.4.120.0080.00916.57
7.4.110.0100.00716.66
7.4.100.0130.00516.57
7.4.90.0130.01016.53
7.4.80.0090.00919.39
7.4.70.0070.01016.64
7.4.60.0140.00316.45
7.4.50.0040.00416.62
7.4.40.0090.00622.77
7.4.30.0030.01316.51
7.4.00.0090.00614.95
7.3.330.0000.00513.16
7.3.320.0000.00613.19
7.3.310.0000.00716.29
7.3.300.0000.00716.27
7.3.290.0030.01016.38
7.3.280.0070.00816.39
7.3.270.0100.00717.40
7.3.260.0130.00618.24
7.3.250.0120.00416.36
7.3.240.0030.01316.61
7.3.230.0040.01316.70
7.3.210.0100.00616.62
7.3.200.0110.00719.39
7.3.190.0090.00916.65
7.3.180.0080.00816.32
7.3.170.0130.00316.56
7.3.160.0100.00616.69
7.3.120.0070.00714.68
7.3.10.0180.00016.42
7.3.00.0070.00716.47
7.2.330.0090.00916.74
7.2.320.0060.01316.75
7.2.310.0140.00416.45
7.2.300.0060.01116.73
7.2.290.0030.01316.78
7.2.130.0110.00716.35
7.2.120.0120.00616.63
7.2.110.0000.01416.59
7.2.100.0100.00316.99
7.2.90.0040.01216.73
7.2.80.0100.01016.56
7.2.70.0080.00816.51
7.2.60.0120.00616.55
7.2.50.0110.00416.58
7.2.40.0060.00916.82
7.2.30.0090.00616.80
7.2.20.0120.00616.66
7.2.10.0140.00316.59
7.2.00.0080.00818.18
7.1.250.0110.00415.31
7.1.240.0070.01415.41
7.1.230.0170.00315.69
7.1.220.0110.00015.65
7.1.210.0090.00915.22
7.1.200.0100.00315.74
7.1.190.0090.00615.63
7.1.180.0110.00815.71
7.1.170.0130.00015.52
7.1.160.0100.00715.54
7.1.150.0120.00615.55
7.1.140.0140.00415.83
7.1.130.0030.01015.63
7.1.120.0090.00315.68
7.1.110.0060.00615.74
7.1.100.0070.00416.60
7.1.90.0130.00315.55
7.1.80.0100.00315.38
7.1.70.0100.00016.30
7.1.60.0040.00917.58
7.1.50.0070.00616.29
7.1.40.0080.00315.64
7.1.30.0040.01215.43
7.1.20.0090.00615.50
7.1.10.0080.00815.58
7.1.00.0060.02019.10
7.0.330.0100.00315.27
7.0.320.0040.01115.32
7.0.310.0060.00915.41
7.0.300.0100.00715.27
7.0.290.0090.00615.12
7.0.280.0130.00315.35
7.0.270.0120.00614.90
7.0.260.0070.01115.44
7.0.250.0070.00715.37
7.0.240.0070.01115.14
7.0.230.0080.00415.27
7.0.220.0110.00415.07
7.0.210.0160.00315.35
7.0.200.0070.00816.21
7.0.190.0100.00715.25
7.0.180.0080.00815.42
7.0.170.0100.01015.35
7.0.160.0070.01115.18
7.0.150.0060.01015.41
7.0.140.0070.03618.68
7.0.130.0110.01115.22
7.0.120.0070.01015.16
7.0.110.0180.00015.08
7.0.100.0100.00715.16
7.0.90.0140.00015.28
7.0.80.0080.04317.67
7.0.70.0170.03017.48
7.0.60.0140.03717.63
7.0.50.0140.03917.88
7.0.40.0120.03516.67
7.0.30.0070.02716.79
7.0.20.0080.04316.56
7.0.10.0090.04716.69
7.0.00.0020.02816.69
5.6.380.0110.00414.45
5.6.370.0200.00314.30
5.6.360.0060.01613.93
5.6.350.0150.00014.12
5.6.340.0060.00914.16
5.6.330.0070.01313.98
5.6.320.0150.00314.23
5.6.310.0130.00513.95
5.6.300.0190.00614.19
5.6.290.0090.01214.47
5.6.280.0090.03417.72
5.6.270.0110.01114.65
5.6.260.0140.00614.39
5.6.250.0160.00614.52
5.6.240.0090.00614.57
5.6.230.0090.04217.50
5.6.220.0070.04517.46
5.6.210.0140.03717.59
5.6.200.0090.04517.71
5.6.190.0100.02917.78
5.6.180.0090.02617.63
5.6.170.0060.04317.45
5.6.160.0100.04917.69
5.6.150.0180.03617.65
5.6.140.0110.04717.56
5.6.130.0060.04517.62
5.6.120.0080.03717.73
5.6.110.0140.04917.63
5.6.100.0140.04417.74
5.6.90.0170.02817.73
5.6.80.0110.04117.36
5.6.70.0120.03817.27
5.6.60.0060.04317.45
5.6.50.0060.04917.19
5.6.40.0070.04317.32
5.6.30.0050.04617.18
5.6.20.0120.04117.30
5.6.10.0080.04117.08
5.6.00.0080.02517.29
5.5.380.0100.00510.98
5.5.370.0070.04315.82
5.5.360.0090.02715.77
5.5.350.0070.04215.90
5.5.340.0140.01816.04
5.5.330.0090.02715.89
5.5.320.0080.04515.93
5.5.310.0110.04016.01
5.5.300.0110.03216.12
5.5.290.0060.03115.84
5.5.280.0100.04216.09
5.5.270.0060.04415.81
5.5.260.0100.03716.02
5.5.250.0090.02615.97
5.5.240.0040.02415.69
5.5.230.0090.04315.64
5.5.220.0010.04315.63
5.5.210.0050.03115.66
5.5.200.0150.02915.55
5.5.190.0050.04315.66
5.5.180.0050.04515.67
5.5.170.0060.00611.07
5.5.160.0070.03315.47
5.5.150.0130.03615.72
5.5.140.0110.04215.75
5.5.130.0090.04015.73
5.5.120.0110.04215.71
5.5.110.0130.03615.52
5.5.100.0060.04015.55
5.5.90.0070.04015.63
5.5.80.0070.03415.63
5.5.70.0050.02415.41
5.5.60.0030.04215.67
5.5.50.0050.03115.42
5.5.40.0080.03815.64
5.5.30.0070.04415.56
5.5.20.0110.03315.71
5.5.10.0070.04015.62
5.5.00.0050.02915.45
5.4.450.0040.04015.07
5.4.440.0030.02815.17
5.4.430.0060.02015.38
5.4.420.0040.03415.44
5.4.410.0070.03715.22
5.4.400.0050.04214.99
5.4.390.0050.03215.02
5.4.380.0120.02314.97
5.4.370.0050.04515.04
5.4.360.0120.02515.06
5.4.350.0030.03015.19
5.4.340.0070.04214.83
5.4.330.0090.00011.02
5.4.320.0120.03815.15
5.4.310.0090.03815.22
5.4.300.0050.02814.86
5.4.290.0070.04015.14
5.4.280.0080.04114.88
5.4.270.0080.04015.07
5.4.260.0130.03315.06
5.4.250.0060.02815.05
5.4.240.0030.04315.09
5.4.230.0100.03515.09
5.4.220.0070.03314.98
5.4.210.0050.03814.83
5.4.200.0260.02314.94
5.4.190.0110.03314.83
5.4.180.0080.03614.82
5.4.170.0040.04215.03
5.4.160.0090.03215.15
5.4.150.0080.04115.22
5.4.140.0050.04013.65
5.4.130.0080.03713.70
5.4.120.0140.02713.60
5.4.110.0080.03813.70
5.4.100.0050.04113.75
5.4.90.0030.03613.78
5.4.80.0080.03813.57
5.4.70.0060.04113.63
5.4.60.0150.02813.83
5.4.50.0080.03713.74
5.4.40.0100.03713.62
5.4.30.0030.04313.73
5.4.20.0110.03713.68
5.4.10.0120.03313.69
5.4.00.0090.02113.51
5.3.290.0040.04212.70
5.3.280.0090.03912.71
5.3.270.0050.02812.67
5.3.260.0080.03112.71
5.3.250.0070.03012.72
5.3.240.0030.04412.65
5.3.230.0080.03012.66
5.3.220.0060.02812.70
5.3.210.0060.02912.65
5.3.200.0050.04412.64
5.3.190.0050.04012.65
5.3.180.0070.03412.63
5.3.170.0060.02412.63
5.3.160.0130.03512.69
5.3.150.0050.02612.64
5.3.140.0040.03912.64
5.3.130.0030.04512.63
5.3.120.0030.03512.62
5.3.110.0050.04312.63
5.3.100.0050.02512.44
5.3.90.0070.03712.42
5.3.80.0030.04412.40
5.3.70.0070.03712.40
5.3.60.0080.03512.42
5.3.50.0080.03612.40
5.3.40.0120.02912.40
5.3.30.0050.02812.40
5.3.20.0050.03812.40
5.3.10.0080.01912.40
5.3.00.0000.04812.40
5.2.170.0060.01812.40
5.2.160.0080.03112.40
5.2.150.0040.02012.40
5.2.140.0000.02812.40
5.2.130.0070.01512.40
5.2.120.0010.01912.40
5.2.110.0040.03212.40
5.2.100.0030.02812.40
5.2.90.0020.03312.40
5.2.80.0080.02012.40
5.2.70.0030.03512.40
5.2.60.0020.03412.40
5.2.50.0030.02812.40
5.2.40.0030.03312.40
5.2.30.0070.02212.40
5.2.20.0020.03512.40
5.2.10.0070.02612.40
5.2.00.0050.03212.40
5.1.60.0070.02112.40
5.1.50.0020.02912.40
5.1.40.0030.03112.40
5.1.30.0060.02212.40
5.1.20.0040.02812.40
5.1.10.0040.02812.40
5.1.00.0020.02912.40
5.0.50.0040.02312.40
5.0.40.0030.01812.40
5.0.30.0030.03012.40
5.0.20.0020.01712.40
5.0.10.0060.02212.40
5.0.00.0040.03412.40
4.4.90.0030.01812.40
4.4.80.0020.01212.40
4.4.70.0010.01112.40
4.4.60.0020.02112.40
4.4.50.0030.01612.40
4.4.40.0020.03012.40
4.4.30.0010.02112.40
4.4.20.0030.01712.40
4.4.10.0000.01712.40
4.4.00.0020.01812.40
4.3.110.0040.01312.40
4.3.100.0020.01312.40
4.3.90.0010.01912.40
4.3.80.0050.02612.40
4.3.70.0050.01312.40
4.3.60.0000.01412.40
4.3.50.0000.01512.40
4.3.40.0040.02712.40
4.3.30.0010.01512.40
4.3.20.0020.02212.40
4.3.10.0030.01312.40
4.3.00.0010.01612.40

preferences:
45.07 ms | 401 KiB | 5 Q