3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Comma Formatted: ' . nyx_number_format('1.233.332,34', 'comma') . '<br />'; 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.0100.01018.36
8.3.50.0090.00722.12
8.3.40.0070.00718.54
8.3.30.0150.00619.06
8.3.20.0040.00420.38
8.3.10.0050.00322.27
8.3.00.0050.00322.56
8.2.180.0060.00916.63
8.2.170.0090.00922.96
8.2.160.0070.00720.84
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0030.00519.48
8.2.110.0030.00622.20
8.2.100.0130.00017.84
8.2.90.0040.00419.25
8.2.80.0060.00317.97
8.2.70.0070.00417.50
8.2.60.0030.00618.05
8.2.50.0060.00318.07
8.2.40.0070.00717.94
8.2.30.0040.00418.00
8.2.20.0000.00717.73
8.2.10.0000.00817.81
8.2.00.0030.00617.92
8.1.280.0080.00825.92
8.1.270.0070.00024.04
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0100.00021.40
8.1.230.0110.00017.82
8.1.220.0050.00317.91
8.1.210.0040.00418.77
8.1.200.0080.00017.23
8.1.190.0040.00417.30
8.1.180.0040.00418.10
8.1.170.0060.00618.63
8.1.160.0040.00422.09
8.1.150.0000.00718.69
8.1.140.0000.00817.40
8.1.130.0030.00317.91
8.1.120.0070.00017.55
8.1.110.0000.00717.49
8.1.100.0070.00017.41
8.1.90.0000.00717.41
8.1.80.0000.00717.41
8.1.70.0000.00717.44
8.1.60.0000.00817.63
8.1.50.0060.00317.58
8.1.40.0000.00817.50
8.1.30.0030.00617.69
8.1.20.0000.00817.71
8.1.10.0070.00017.52
8.1.00.0000.00917.51
8.0.300.0070.00018.77
8.0.290.0030.00517.18
8.0.280.0050.00318.56
8.0.270.0070.00017.20
8.0.260.0000.00816.89
8.0.250.0000.00717.03
8.0.240.0000.00717.07
8.0.230.0000.00717.07
8.0.220.0030.00317.01
8.0.210.0000.00716.89
8.0.200.0030.00317.08
8.0.190.0000.00817.01
8.0.180.0080.00016.89
8.0.170.0030.00616.89
8.0.160.0000.00716.97
8.0.150.0030.00316.95
8.0.140.0000.00716.90
8.0.130.0050.00013.40
8.0.120.0030.00516.91
8.0.110.0030.00516.88
8.0.100.0040.00417.01
8.0.90.0000.00717.00
8.0.80.0100.00716.96
8.0.70.0050.00317.04
8.0.60.0000.00817.01
8.0.50.0040.00416.90
8.0.30.0130.00717.23
8.0.20.0140.00517.40
8.0.10.0000.00816.93
8.0.00.0100.01116.88
7.4.330.0000.00515.05
7.4.320.0070.00016.60
7.4.300.0060.00016.57
7.4.290.0000.00816.56
7.4.280.0000.00716.57
7.4.270.0080.00016.57
7.4.260.0000.00716.68
7.4.250.0040.00416.49
7.4.240.0040.00416.67
7.4.230.0070.00016.68
7.4.220.0150.01116.52
7.4.210.0040.01216.64
7.4.200.0070.00016.70
7.4.190.0030.00316.73
7.4.160.0090.00616.51
7.4.150.0070.01117.40
7.4.140.0130.01017.86
7.4.130.0080.00816.64
7.4.120.0070.01116.75
7.4.110.0090.01216.60
7.4.100.0180.00316.59
7.4.90.0060.01216.55
7.4.80.0120.00616.60
7.4.70.0060.01116.73
7.4.60.0080.00816.55
7.4.50.0000.00816.29
7.4.40.0100.00622.77
7.4.30.0100.00716.68
7.4.00.0070.00914.82
7.3.330.0000.00513.17
7.3.320.0000.00513.24
7.3.310.0080.00016.28
7.3.300.0050.00216.43
7.3.290.0030.01016.40
7.3.280.0100.00816.36
7.3.270.0090.00617.40
7.3.260.0110.01116.38
7.3.250.0080.01216.40
7.3.240.0030.01416.46
7.3.230.0140.00316.63
7.3.210.0000.01716.73
7.3.200.0080.00919.39
7.3.190.0130.00316.55
7.3.180.0140.00316.41
7.3.170.0080.01116.41
7.3.160.0140.00316.48
7.3.120.0090.00715.01
7.3.110.0070.01014.87
7.3.100.0100.00515.08
7.3.90.0080.00814.80
7.3.80.0050.00714.60
7.3.70.0050.01014.79
7.3.60.0080.00314.83
7.3.50.0040.00814.79
7.3.40.0050.00914.77
7.3.30.0040.00514.63
7.3.20.0080.00816.73
7.3.10.0020.01416.48
7.3.00.0080.00716.63
7.2.330.0070.01016.82
7.2.320.0030.01416.74
7.2.310.0140.00316.89
7.2.300.0060.01116.70
7.2.290.0130.00316.83
7.2.250.0080.00915.13
7.2.240.0110.00615.23
7.2.230.0090.00515.17
7.2.220.0050.01115.08
7.2.210.0070.01015.05
7.2.200.0030.01114.90
7.2.190.0100.00415.00
7.2.180.0110.00615.08
7.2.170.0030.01314.92
7.2.00.0070.00719.48
7.1.330.0090.00515.68
7.1.320.0050.00915.78
7.1.310.0070.00815.87
7.1.300.0040.00715.60
7.1.290.0070.00615.59
7.1.280.0030.00715.71
7.1.270.0080.00315.74
7.1.260.0080.00515.82
7.1.200.0070.00315.80
7.1.100.0000.01517.78
7.1.70.0000.00817.21
7.1.60.0100.01019.82
7.1.50.0070.01316.58
7.1.00.0030.07722.46
7.0.200.0100.00316.83
7.0.140.0070.09022.23
7.0.60.0170.07019.96
7.0.50.0030.05017.95
7.0.40.0030.09320.05
7.0.30.0300.03720.08
7.0.20.0300.05020.23
7.0.10.0130.08320.09
7.0.00.0030.08720.20
5.6.280.0070.06720.86
5.6.210.0130.07020.55
5.6.200.0100.04718.12
5.6.190.0000.05020.63
5.6.180.0330.07020.63
5.6.170.0370.07020.59
5.6.160.0000.07320.48
5.6.150.0000.08718.16
5.6.140.0070.08318.21
5.6.130.0030.04018.20
5.6.120.0070.08321.02
5.6.110.0100.07721.03
5.6.100.0030.08320.98
5.6.90.0100.04020.99
5.6.80.0100.06320.52
5.5.350.4300.04320.47
5.5.340.0030.08717.97
5.5.330.0100.03720.47
5.5.320.0430.04020.26
5.5.310.0330.04020.48
5.5.300.0000.04317.96
5.5.290.0070.03717.95
5.5.280.0030.08720.80
5.5.270.0030.07020.64
5.5.260.0030.04320.78
5.5.250.0030.04020.67
5.5.240.0070.08020.08
5.4.450.0470.06019.54
5.4.440.0930.04319.16
5.4.430.0200.06319.43
5.4.420.0930.06019.59
5.4.410.0130.05019.47
5.4.400.0600.06319.39
5.4.390.0700.06319.35
5.4.380.0170.05318.79
5.4.370.0230.04318.72
5.4.360.0200.04718.62
5.4.350.0200.05018.73
5.4.340.0170.05018.61
5.4.320.0080.04312.51
5.4.310.0070.04612.50
5.4.300.0040.04812.51
5.4.290.0060.04512.50
5.4.280.0080.04212.40
5.4.270.0070.03612.40
5.4.260.0070.04012.41
5.4.250.0050.04412.40
5.4.240.0080.04012.40
5.4.230.0060.03812.39
5.4.220.0060.03912.40
5.4.210.0070.03612.39
5.4.200.0050.04212.40
5.4.190.0350.06512.37
5.4.180.0140.04912.37
5.4.170.0130.04912.39
5.4.160.0220.04112.38
5.4.150.0210.04212.37
5.4.140.0150.04612.05
5.4.130.0280.09812.04
5.4.120.0190.04512.00
5.4.110.0140.04312.00
5.4.100.0330.08912.00
5.4.90.0130.05012.00
5.4.80.0280.06312.00
5.4.70.0170.04312.00
5.4.60.0120.04712.00
5.4.50.0270.03712.00
5.4.40.0420.08311.98
5.4.30.0130.04711.98
5.4.20.0180.04111.98
5.4.10.0170.03911.98
5.4.00.0150.04211.47
5.3.290.0080.04512.80
5.3.280.0050.03812.70
5.3.270.0280.06612.72
5.3.260.0190.04712.72
5.3.250.0190.04312.71
5.3.240.0180.04512.72
5.3.230.0170.04812.71
5.3.220.0400.08312.68
5.3.210.0170.04512.68
5.3.200.0140.05312.68
5.3.190.0210.04212.68
5.3.180.0130.04912.67
5.3.170.0300.06212.67
5.3.160.0170.04512.67
5.3.150.0220.04112.67
5.3.140.0200.04312.66
5.3.130.0200.04412.66
5.3.120.0150.04912.66
5.3.110.0180.04812.66
5.3.100.0240.04112.12
5.3.90.0150.04812.09
5.3.80.0100.05012.07
5.3.70.0240.06612.07
5.3.60.0140.04812.06
5.3.50.0210.07012.00
5.3.40.0110.04712.00
5.3.30.0140.04211.98
5.3.20.0120.04611.75
5.3.10.0180.03811.72
5.3.00.0150.04011.70
5.2.170.0110.0369.22
5.2.160.0100.0369.21
5.2.150.0100.0379.21
5.2.140.0120.0379.22
5.2.130.0150.0319.18
5.2.120.0150.0319.17
5.2.110.0140.0339.18
5.2.100.0090.0379.19
5.2.90.0100.0369.19
5.2.80.0150.0349.17
5.2.70.0110.0409.17
5.2.60.0350.0729.12
5.2.50.0110.0359.09
5.2.40.0110.0369.07
5.2.30.0090.0389.04
5.2.20.0100.0369.04
5.2.10.0130.0348.95
5.2.00.0130.0328.80
5.1.60.0100.0318.09
5.1.50.0070.0348.08
5.1.40.0150.0248.07
5.1.30.0110.0318.41
5.1.20.0110.0308.44
5.1.10.0100.0338.16
5.1.00.0080.0338.16
5.0.50.0320.0626.65
5.0.40.0070.0246.50
5.0.30.0070.0376.32
5.0.20.0140.0196.30
5.0.10.0080.0246.28
5.0.00.0080.0366.28
4.4.90.0080.0204.78
4.4.80.0100.0154.75
4.4.70.0060.0204.75
4.4.60.0060.0194.75
4.4.50.0070.0184.77
4.4.40.0070.0294.71
4.4.30.0070.0184.76
4.4.20.0160.0404.84
4.4.10.0090.0164.84
4.4.00.0080.0274.76
4.3.110.0060.0184.67
4.3.100.0070.0174.66
4.3.90.0070.0174.63
4.3.80.0080.0264.58
4.3.70.0080.0164.63
4.3.60.0080.0164.63
4.3.50.0050.0194.63
4.3.40.0060.0294.54
4.3.30.0070.0163.33
4.3.20.0040.0193.31
4.3.10.0070.0173.28
4.3.00.0100.0276.61

preferences:
48.83 ms | 401 KiB | 5 Q