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.70.0100.01018.43
8.3.60.0100.00316.50
8.3.50.0150.00517.38
8.3.40.0120.00318.50
8.3.30.0140.00018.67
8.3.20.0040.00418.61
8.3.10.0040.00420.52
8.3.00.0030.00519.26
8.2.180.0180.00316.75
8.2.170.0140.00022.96
8.2.160.0060.01220.70
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0020.00526.16
8.2.120.0040.00419.27
8.2.110.0040.00421.11
8.2.100.0080.00417.78
8.2.90.0060.00319.30
8.2.80.0020.00519.46
8.2.70.0000.00817.63
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0080.00018.16
8.2.30.0060.00318.05
8.2.20.0060.00317.71
8.2.10.0030.00617.83
8.2.00.0040.00417.81
8.1.280.0070.01025.92
8.1.270.0050.00524.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00622.59
8.1.230.0090.00321.02
8.1.220.0050.00317.78
8.1.210.0030.00618.88
8.1.200.0030.00617.38
8.1.190.0040.00417.66
8.1.180.0060.00318.10
8.1.170.0030.00518.95
8.1.160.0050.00318.88
8.1.150.0000.00718.70
8.1.140.0040.00417.57
8.1.130.0030.00317.85
8.1.120.0040.00417.51
8.1.110.0000.00817.54
8.1.100.0040.00317.51
8.1.90.0030.00317.44
8.1.80.0000.00717.60
8.1.70.0000.00717.53
8.1.60.0050.00517.69
8.1.50.0040.00417.56
8.1.40.0030.00617.50
8.1.30.0040.00417.75
8.1.20.0040.00417.77
8.1.10.0040.00417.57
8.1.00.0040.00417.52
8.0.300.0000.00920.00
8.0.290.0080.00016.75
8.0.280.0030.00318.45
8.0.270.0070.00017.39
8.0.260.0000.00616.80
8.0.250.0000.00717.10
8.0.240.0000.00717.00
8.0.230.0040.00417.03
8.0.220.0030.00316.95
8.0.210.0070.00016.98
8.0.200.0000.00617.02
8.0.190.0040.00416.98
8.0.180.0070.00016.97
8.0.170.0030.00616.88
8.0.160.0070.00016.98
8.0.150.0080.00016.99
8.0.140.0080.00016.93
8.0.130.0050.00013.36
8.0.120.0070.00016.92
8.0.110.0000.00816.96
8.0.100.0030.00616.77
8.0.90.0000.00716.86
8.0.80.0040.01416.87
8.0.70.0040.00416.85
8.0.60.0040.00416.75
8.0.50.0050.00216.97
8.0.30.0030.01617.07
8.0.20.0080.01417.08
8.0.10.0080.00017.15
8.0.00.0100.01216.81
7.4.330.0000.00513.07
7.4.320.0030.00316.68
7.4.300.0030.00316.63
7.4.290.0000.00716.59
7.4.280.0000.00816.49
7.4.270.0040.00416.61
7.4.260.0000.00513.29
7.4.250.0040.00416.67
7.4.240.0000.00716.64
7.4.230.0030.00316.33
7.4.220.0100.01316.70
7.4.210.0100.00716.59
7.4.200.0070.00016.70
7.4.190.0030.00316.54
7.4.160.0150.00016.57
7.4.150.0180.00016.63
7.4.140.0100.00916.67
7.4.130.0070.01216.62
7.4.120.0090.00716.56
7.4.110.0090.01216.66
7.4.100.0120.01216.57
7.4.90.0090.00916.48
7.4.80.0100.00919.39
7.4.70.0100.00716.66
7.4.60.0100.00716.52
7.4.50.0050.00216.48
7.4.40.0110.00016.55
7.4.30.0030.01316.75
7.4.10.0060.01215.02
7.4.00.0050.01114.95
7.3.330.0000.00613.37
7.3.320.0060.00013.35
7.3.310.0040.00416.36
7.3.300.0030.00316.25
7.3.290.0120.00316.30
7.3.280.0080.01116.38
7.3.270.0160.00316.48
7.3.260.0090.00816.35
7.3.250.0120.00516.58
7.3.240.0100.00716.48
7.3.230.0090.00916.41
7.3.210.0120.00416.41
7.3.200.0160.00016.61
7.3.190.0130.00316.42
7.3.180.0040.01316.53
7.3.170.0130.00716.67
7.3.160.0040.01616.70
7.3.130.0070.01015.03
7.3.120.0020.01114.93
7.3.110.0060.01314.88
7.3.100.0090.00614.90
7.3.90.0030.00614.95
7.3.80.0070.00715.05
7.3.70.0000.01014.54
7.3.60.0030.00514.55
7.3.50.0030.00914.83
7.3.40.0060.00914.88
7.3.30.0060.00314.70
7.3.20.0050.00516.66
7.3.10.0070.00716.63
7.3.00.0040.00416.69
7.2.330.0160.00316.86
7.2.320.0040.01416.60
7.2.310.0060.01516.66
7.2.300.0060.01116.64
7.2.290.0160.00016.70
7.2.260.0040.01114.75
7.2.250.0070.01114.90
7.2.240.0060.01015.35
7.2.230.0030.01014.80
7.2.220.0060.00914.97
7.2.210.0040.00815.09
7.2.200.0040.01114.88
7.2.190.0070.00714.94
7.2.180.0100.00015.22
7.2.170.0090.00315.11
7.2.160.0000.00815.12
7.2.150.0030.01016.91
7.2.140.0110.00416.96
7.2.130.0090.00317.03
7.2.120.0060.00616.96
7.2.110.0030.00716.84
7.2.100.0070.01117.02
7.2.90.0100.00016.98
7.2.80.0100.00316.95
7.2.70.0060.00316.75
7.2.60.0100.00716.87
7.2.50.0030.01017.05
7.2.40.0110.00316.80
7.2.30.0060.00916.88
7.2.20.0030.00716.93
7.2.10.0060.00916.93
7.2.00.0030.00818.28
7.1.330.0030.01015.46
7.1.320.0060.00315.81
7.1.310.0060.00615.64
7.1.300.0030.01315.72
7.1.290.0040.00815.55
7.1.280.0090.00315.80
7.1.270.0030.00615.68
7.1.260.0000.00815.96
7.1.250.0030.00915.77
7.1.240.0030.01015.97
7.1.230.0000.01315.81
7.1.220.0060.00315.71
7.1.210.0040.01115.91
7.1.200.0090.00315.88
7.1.190.0000.01115.77
7.1.180.0070.00415.65
7.1.170.0030.01015.44
7.1.160.0060.00615.52
7.1.150.0070.00415.89
7.1.140.0030.00715.82
7.1.130.0060.00615.70
7.1.120.0030.00615.61
7.1.110.0070.00715.87
7.1.100.0060.00617.01
7.1.90.0040.00815.64
7.1.80.0080.00415.84
7.1.70.0020.01016.19
7.1.60.0070.01117.61
7.1.50.0040.01116.38
7.1.40.0030.01315.62
7.1.30.0090.00615.51
7.1.20.0040.01215.48
7.1.10.0030.00715.55
7.1.00.0040.02819.14
7.0.330.0000.00815.15
7.0.320.0090.00315.49
7.0.310.0030.00615.61
7.0.300.0000.00915.41
7.0.290.0030.00915.39
7.0.280.0070.00715.57
7.0.270.0070.00315.41
7.0.260.0100.00015.54
7.0.250.0090.00315.36
7.0.240.0040.00815.61
7.0.230.0040.00415.21
7.0.220.0030.00615.42
7.0.210.0000.01415.12
7.0.200.0060.00315.29
7.0.190.0080.00315.33
7.0.180.0030.01315.37
7.0.170.0140.00015.45
7.0.160.0090.00615.09
7.0.150.0070.00315.17
7.0.140.0060.03818.71
7.0.130.0030.00715.28
7.0.120.0000.03018.70
7.0.110.0030.00615.39
7.0.100.0060.00815.45
7.0.90.0090.00315.43
7.0.80.0080.00015.25
7.0.70.0070.00415.36
7.0.60.0030.04518.56
7.0.50.0050.02016.67
7.0.40.0030.04716.84
7.0.30.0030.04916.93
7.0.20.0110.04016.90
7.0.10.0020.04316.85
7.0.00.0080.03916.83
5.6.400.0000.00814.34
5.6.390.0060.00914.66
5.6.380.0000.01014.18
5.6.370.0030.00614.11
5.6.360.0000.01014.49
5.6.350.0000.01114.28
5.6.340.0000.01214.62
5.6.330.0060.00614.40
5.6.320.0090.00614.34
5.6.310.0100.00314.35
5.6.300.0090.00614.50
5.6.290.0060.01214.46
5.6.280.0080.00814.23
5.6.270.0030.01014.62
5.6.260.0060.00614.59
5.6.250.0060.00914.30
5.6.240.0030.00914.26
5.6.230.0060.00914.38
5.6.220.0030.01414.04
5.6.210.0050.04417.30
5.6.200.0050.03716.27
5.6.190.0070.04717.45
5.6.180.0090.03917.37
5.6.170.0070.04417.48
5.6.160.0030.04517.30
5.6.150.0100.04017.20
5.6.140.0030.04817.21
5.6.130.0030.04917.48
5.6.120.0060.03117.23
5.6.110.0050.04017.33
5.6.100.0070.04017.28
5.6.90.0110.03817.38
5.6.80.0030.02916.92
5.6.70.0040.02416.96
5.6.60.0110.03916.92
5.6.50.0030.03316.81
5.6.40.0030.02817.00
5.6.30.0050.03816.94
5.6.20.0070.03916.96
5.6.10.0040.04416.75
5.6.00.0030.04817.05
5.5.380.0060.00814.34
5.5.370.0000.01114.50
5.5.360.0000.01414.04
5.5.350.0060.04617.40
5.5.340.0040.02416.14
5.5.330.0030.04817.50
5.5.320.0030.04217.43
5.5.310.0050.04217.16
5.5.300.0060.04617.04
5.5.290.0070.02517.33
5.5.280.0080.04217.39
5.5.270.0030.05017.16
5.5.260.0050.04517.18
5.5.250.0050.04217.06
5.5.240.0110.04017.03
5.5.230.0070.04116.80
5.5.220.0070.04316.82
5.5.210.0070.03716.97
5.5.200.0030.04216.80
5.5.190.0050.04416.63
5.5.180.0050.04216.65
5.5.170.0100.00313.97
5.5.160.0000.04616.91
5.5.150.0060.04316.79
5.5.140.0050.04216.92
5.5.130.0160.03916.79
5.5.120.0050.04316.91
5.5.110.0020.04216.96
5.5.100.0030.04116.78
5.5.90.0030.03716.77
5.5.80.0050.04016.64
5.5.70.0080.04316.86
5.5.60.0040.02616.94
5.5.50.0050.03416.85
5.5.40.0020.04716.90
5.5.30.0060.03516.71
5.5.20.0050.04416.73
5.5.10.0070.03016.80
5.5.00.0070.04416.68
5.4.450.0020.04516.02
5.4.440.0050.04216.01
5.4.430.0020.04516.04
5.4.420.0030.04115.86
5.4.410.0030.03816.00
5.4.400.0030.04115.80
5.4.390.0050.02915.85
5.4.380.0050.04015.71
5.4.370.0020.04115.87
5.4.360.0070.02815.87
5.4.350.0070.03315.75
5.4.340.0050.03915.89
5.4.330.0000.01212.56
5.4.320.0050.04015.87
5.4.310.0050.03515.90
5.4.300.0090.03715.89
5.4.290.0040.03715.85
5.4.280.0050.04215.74
5.4.270.0040.03515.85
5.4.260.0050.04215.79
5.4.250.0070.03315.80
5.4.240.0050.04315.89
5.4.230.0050.03215.87
5.4.220.0030.04215.84
5.4.210.0030.03515.89
5.4.200.0000.02615.70
5.4.190.0030.04015.84
5.4.180.0020.04315.80
5.4.170.0050.03715.87
5.4.160.0030.04315.84
5.4.150.0020.03815.91
5.4.140.0060.02614.57
5.4.130.0050.02714.58
5.4.120.0050.02814.45
5.4.110.0070.03514.52
5.4.100.0050.04014.55
5.4.90.0000.04214.53
5.4.80.0050.03814.49
5.4.70.0030.03614.45
5.4.60.0040.04214.53
5.4.50.0030.03914.51
5.4.40.0040.04014.41
5.4.30.0050.02614.50
5.4.20.0030.03814.40
5.4.10.0050.02914.44
5.4.00.0020.03614.15
5.3.290.0050.04113.62
5.3.280.0010.03213.52
5.3.270.0080.04113.60
5.3.260.0060.04513.60
5.3.250.0070.03513.58
5.3.240.0030.03613.63
5.3.230.0050.03413.57
5.3.220.0070.03813.57
5.3.210.0070.04213.55
5.3.200.0100.03713.64
5.3.190.0090.03913.60
5.3.180.0030.04213.56
5.3.170.0050.04213.57
5.3.160.0080.03813.63
5.3.150.0070.03813.58
5.3.140.0070.03513.58
5.3.130.0050.04213.59
5.3.120.0040.04613.51
5.3.110.0030.03713.59
5.3.100.0050.03513.29
5.3.90.0000.04413.32
5.3.80.0050.02513.37
5.3.70.0050.02613.28
5.3.60.0070.03313.29
5.3.50.0020.04013.22
5.3.40.0050.04313.25
5.3.30.0080.03813.25
5.3.20.0020.04213.20
5.3.10.0030.03313.11
5.3.00.0020.04213.09
5.2.170.0030.04711.75
5.2.160.0070.04011.75
5.2.150.0000.05011.75
5.2.140.0030.06311.75
5.2.130.0030.06311.75
5.2.120.0030.06011.75
5.2.110.0030.04311.75
5.2.100.0030.06311.75
5.2.90.0000.05011.75
5.2.80.0000.06711.75
5.2.70.0000.06311.75
5.2.60.0070.05311.75
5.2.50.0000.05311.75
5.2.40.0070.05311.75
5.2.30.0030.06311.75
5.2.20.0070.06011.75
5.2.10.0030.04011.75
5.2.00.0070.05711.75
5.1.60.0000.05711.75
5.1.50.0030.02311.75
5.1.40.0030.04011.75
5.1.30.0000.04311.75
5.1.20.0070.04311.75
5.1.10.0030.05311.75
5.1.00.0030.05311.75
5.0.50.0000.05011.75
5.0.40.0030.04311.75
5.0.30.0030.06011.75
5.0.20.0000.04311.75
5.0.10.0000.04711.75
5.0.00.0000.07011.75
4.4.90.0000.03711.75
4.4.80.0000.03711.75
4.4.70.0000.03311.75
4.4.60.0000.03711.75
4.4.50.0000.03711.75
4.4.40.0000.03711.75
4.4.30.0030.02011.75
4.4.20.0030.02311.75
4.4.10.0000.03311.75
4.4.00.0070.04711.75
4.3.110.0030.02711.75
4.3.100.0030.03311.75
4.3.90.0000.03311.75
4.3.80.0000.05311.75
4.3.70.0000.03711.75
4.3.60.0000.03311.75
4.3.50.0030.03311.75
4.3.40.0030.05011.75
4.3.30.0000.03711.75
4.3.20.0000.04011.75
4.3.10.0030.03711.75
4.3.00.0030.03311.75

preferences:
50.54 ms | 401 KiB | 5 Q