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'); 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.0160.00318.05
8.3.60.0070.01418.23
8.3.50.0170.00521.93
8.3.40.0110.00418.52
8.3.30.0070.00719.04
8.3.20.0080.00020.29
8.3.10.0030.00522.09
8.3.00.0040.00422.39
8.2.180.0040.01118.41
8.2.170.0110.00322.96
8.2.160.0040.01121.07
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.49
8.2.110.0050.00520.66
8.2.100.0060.00617.97
8.2.90.0060.00319.21
8.2.80.0040.00417.97
8.2.70.0000.01017.63
8.2.60.0090.00017.92
8.2.50.0030.00618.07
8.2.40.0050.00318.16
8.2.30.0050.00218.06
8.2.20.0000.00717.76
8.2.10.0040.00417.88
8.2.00.0040.00417.87
8.1.280.0140.00325.92
8.1.270.0030.00623.95
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0070.00321.89
8.1.230.0030.00920.99
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.38
8.1.190.0040.00417.53
8.1.180.0030.00518.10
8.1.170.0080.00418.73
8.1.160.0000.00722.09
8.1.150.0000.00718.71
8.1.140.0000.00717.53
8.1.130.0080.00017.88
8.1.120.0000.00717.59
8.1.110.0000.00817.50
8.1.100.0030.00617.49
8.1.90.0000.00817.54
8.1.80.0000.00817.45
8.1.70.0030.00317.51
8.1.60.0050.00317.68
8.1.50.0000.00817.46
8.1.40.0090.00017.61
8.1.30.0040.00417.69
8.1.20.0080.00017.75
8.1.10.0040.00417.60
8.1.00.0080.00017.50
8.0.300.0040.00418.77
8.0.290.0070.00017.28
8.0.280.0000.00718.57
8.0.270.0000.00717.24
8.0.260.0030.00316.89
8.0.250.0030.00316.95
8.0.240.0000.00716.92
8.0.230.0000.00816.96
8.0.220.0030.00316.87
8.0.210.0000.00716.92
8.0.200.0040.00417.00
8.0.190.0000.00816.98
8.0.180.0050.00217.03
8.0.170.0040.00416.98
8.0.160.0050.00216.86
8.0.150.0000.00816.87
8.0.140.0000.00716.96
8.0.130.0060.00013.39
8.0.120.0040.00416.95
8.0.110.0000.00716.91
8.0.100.0040.00416.95
8.0.90.0000.00716.82
8.0.80.0120.00316.96
8.0.70.0070.00016.93
8.0.60.0000.00816.77
8.0.50.0050.00316.81
8.0.30.0120.00717.29
8.0.20.0070.01317.40
8.0.10.0040.00417.04
8.0.00.0110.00616.80
7.4.330.0000.00515.15
7.4.320.0060.00016.59
7.4.300.0000.00616.63
7.4.290.0000.00716.47
7.4.280.0040.00416.58
7.4.270.0040.00416.58
7.4.260.0030.00416.56
7.4.250.0000.00716.45
7.4.240.0000.00716.65
7.4.230.0030.00316.69
7.4.220.0110.00716.65
7.4.210.0080.00716.65
7.4.200.0030.00316.32
7.4.190.0000.00716.55
7.4.160.0060.00916.52
7.4.150.0130.01017.40
7.4.140.0090.00817.86
7.4.130.0090.00816.58
7.4.120.0110.00616.62
7.4.110.0070.01016.45
7.4.100.0040.01416.61
7.4.90.0040.02016.48
7.4.80.0120.00616.56
7.4.70.0110.00416.32
7.4.60.0080.00816.77
7.4.50.0050.00316.46
7.4.40.0060.00922.77
7.4.30.0030.01316.55
7.4.10.0070.01015.12
7.4.00.0050.01214.98
7.3.330.0000.00513.21
7.3.320.0050.00013.39
7.3.310.0000.00716.41
7.3.300.0070.00016.23
7.3.290.0030.01716.37
7.3.280.0100.00716.35
7.3.270.0150.00517.40
7.3.260.0100.01416.54
7.3.250.0100.00916.57
7.3.240.0150.00616.42
7.3.230.0070.01016.39
7.3.210.0190.00016.65
7.3.200.0130.00919.39
7.3.190.0080.00816.68
7.3.180.0060.00916.45
7.3.170.0100.00616.49
7.3.160.0060.01216.62
7.3.130.0100.01014.97
7.3.120.0120.00514.77
7.3.110.0120.00314.33
7.3.100.0040.01014.90
7.3.90.0050.00814.74
7.3.80.0080.00514.98
7.3.70.0080.00614.54
7.3.60.0030.00914.67
7.3.50.0050.01014.75
7.3.40.0060.00614.73
7.3.30.0050.01114.63
7.3.20.0040.00916.57
7.3.10.0080.00816.63
7.3.00.0070.00716.66
7.2.330.0270.01716.77
7.2.320.0030.01416.79
7.2.310.0140.00316.85
7.2.300.0160.00016.48
7.2.290.0090.00616.88
7.2.260.0170.00314.79
7.2.250.0100.01014.66
7.2.240.0090.00514.87
7.2.230.0070.00715.02
7.2.220.0030.01215.09
7.2.210.0030.00915.07
7.2.200.0050.01014.76
7.2.190.0050.00714.86
7.2.180.0050.00815.04
7.2.170.0060.00914.96
7.2.160.0040.00914.89
7.2.150.0050.00916.70
7.2.140.0040.01316.69
7.2.130.0070.00816.53
7.2.120.0080.00916.79
7.2.110.0070.00816.60
7.2.100.0100.00516.71
7.2.90.0090.00816.53
7.2.80.0070.01016.88
7.2.70.0020.01016.85
7.2.60.0100.00516.85
7.2.50.0100.00816.94
7.2.40.0050.01016.73
7.2.30.0040.01116.90
7.2.20.0030.01016.75
7.2.10.0060.00616.90
7.2.00.0050.01117.63
7.1.330.0050.01015.80
7.1.320.0090.00315.60
7.1.310.0070.00715.81
7.1.300.0100.00515.53
7.1.290.0060.00715.68
7.1.280.0060.00615.54
7.1.270.0070.00515.41
7.1.260.0060.00515.75
7.1.250.0060.00815.50
7.1.240.0000.01315.65
7.1.230.0070.00315.52
7.1.220.0040.01115.69
7.1.210.0100.00715.52
7.1.200.0070.00815.52
7.1.190.0070.00715.70
7.1.180.0070.00315.39
7.1.170.0030.01015.53
7.1.160.0100.00015.62
7.1.150.0060.00615.59
7.1.140.0100.00715.56
7.1.130.0000.01915.33
7.1.120.0030.01015.76
7.1.110.0000.01115.52
7.1.100.0090.00416.85
7.1.90.0070.01015.78
7.1.80.0040.01115.79
7.1.70.0050.00716.33
7.1.60.0060.01217.79
7.1.50.0100.00616.07
7.1.40.0030.01015.63
7.1.30.0030.01415.72
7.1.20.0070.01015.55
7.1.10.0000.00915.68
7.1.00.0000.04518.88
7.0.330.0110.00415.02
7.0.320.0110.00415.25
7.0.310.0040.01115.08
7.0.300.0030.01014.85
7.0.290.0000.01315.24
7.0.280.0090.00614.99
7.0.270.0040.00814.99
7.0.260.0070.00715.27
7.0.250.0000.01515.31
7.0.240.0090.00615.23
7.0.230.0030.01015.06
7.0.220.0040.01115.20
7.0.210.0040.01115.53
7.0.200.0050.00716.15
7.0.190.0000.01015.12
7.0.180.0080.00515.38
7.0.170.0040.01215.21
7.0.160.0060.00915.32
7.0.150.0070.00415.28
7.0.140.0050.04118.75
7.0.130.0070.00715.42
7.0.120.0040.00415.19
7.0.110.0100.00015.38
7.0.100.0070.02517.50
7.0.90.0050.04317.50
7.0.80.0070.02717.56
7.0.70.0050.02317.60
7.0.60.0040.04617.64
7.0.50.0070.04717.83
7.0.40.0070.04516.79
7.0.30.0070.04516.79
7.0.20.0080.04516.93
7.0.10.0040.03516.67
7.0.00.0080.04316.64
5.6.400.0030.01514.10
5.6.390.0030.00613.98
5.6.380.0090.00513.83
5.6.370.0040.00714.18
5.6.360.0030.00913.78
5.6.350.0000.01514.09
5.6.340.0060.01213.94
5.6.330.0040.01414.01
5.6.320.0060.00614.44
5.6.310.0040.01114.55
5.6.300.0130.00014.11
5.6.290.0060.00613.97
5.6.280.0050.03617.66
5.6.270.0030.00614.41
5.6.260.0150.00014.51
5.6.250.0070.04717.46
5.6.240.0020.03817.37
5.6.230.0030.02817.44
5.6.220.0070.03817.41
5.6.210.0100.03217.38
5.6.200.0040.02517.48
5.6.190.0140.03217.61
5.6.180.0080.04117.59
5.6.170.0080.03517.71
5.6.160.0070.02717.63
5.6.150.0130.02817.64
5.6.140.0030.03017.67
5.6.130.0030.02517.70
5.6.120.0080.04017.56
5.6.110.0080.04117.54
5.6.100.0020.03017.63
5.6.90.0100.03917.60
5.6.80.0100.04117.17
5.6.70.0080.02017.23
5.6.60.0030.04117.20
5.6.50.0060.02517.25
5.6.40.0030.02617.34
5.6.30.0060.02117.23
5.6.20.0040.03217.23
5.6.10.0050.02817.16
5.6.00.0050.03717.20
5.5.380.0080.02517.33
5.5.370.0050.04517.42
5.5.360.0030.04317.10
5.5.350.0020.03317.02
5.5.340.0070.03217.36
5.5.330.0050.04417.27
5.5.320.0060.04117.49
5.5.310.0060.03017.52
5.5.300.0080.02317.41
5.5.290.0090.03717.59
5.5.280.0070.04217.68
5.5.270.0070.02217.32
5.5.260.0030.03217.70
5.5.250.0070.03917.46
5.5.240.0090.04217.16
5.5.230.0070.04217.17
5.5.220.0020.03317.23
5.5.210.0040.04717.18
5.5.200.0100.02217.27
5.5.190.0100.03217.30
5.5.180.0100.03917.16
5.5.170.0140.00013.87
5.5.160.0020.03217.26
5.5.150.0030.02717.22
5.5.140.0050.02317.16
5.5.130.0050.04217.23
5.5.120.0050.02817.38
5.5.110.0050.04217.32
5.5.100.0070.03017.17
5.5.90.0100.03516.92
5.5.80.0050.04017.09
5.5.70.0070.03017.24
5.5.60.0100.03717.18
5.5.50.0030.02516.87
5.5.40.0130.02716.96
5.5.30.0050.02617.18
5.5.20.0040.02617.14
5.5.10.0050.02617.13
5.5.00.0120.01517.17
5.4.450.0020.04416.16
5.4.440.0040.02716.03
5.4.430.0020.04616.10
5.4.420.0080.02516.10
5.4.410.0020.04716.07
5.4.400.0070.02316.03
5.4.390.0090.03715.95
5.4.380.0040.02715.94
5.4.370.0050.04215.85
5.4.360.0050.02815.95
5.4.350.0060.03115.99
5.4.340.0020.03516.04
5.4.330.0030.00612.76
5.4.320.0060.02616.03
5.4.310.0030.02615.95
5.4.300.0020.03315.93
5.4.290.0080.02415.99
5.4.280.0020.04515.97
5.4.270.0080.03616.00
5.4.260.0080.02115.97
5.4.250.0110.03615.98
5.4.240.0060.02615.93
5.4.230.0050.04215.98
5.4.220.0020.03915.93
5.4.210.0080.03515.94
5.4.200.0060.02215.88
5.4.190.0070.01915.85
5.4.180.0050.02015.94
5.4.170.0040.02416.02
5.4.160.0030.02315.94
5.4.150.0040.02415.83
5.4.140.0010.02214.63
5.4.130.0050.01914.53
5.4.120.0050.01914.66
5.4.110.0030.02314.60
5.4.100.0030.02314.63
5.4.90.0050.02014.62
5.4.80.0120.01014.57
5.4.70.0020.01914.58
5.4.60.0010.02014.63
5.4.50.0050.02514.62
5.4.40.0050.01814.66
5.4.30.0030.01714.66
5.4.20.0060.01614.58
5.4.10.0050.01714.60
5.4.00.0000.02514.30
5.3.290.0020.03013.78
5.3.280.0030.03213.70
5.3.270.0000.04113.74
5.3.260.0030.02213.68
5.3.250.0050.02013.74
5.3.240.0020.02213.68
5.3.230.0050.02013.69
5.3.220.0030.02113.73
5.3.210.0030.01813.73
5.3.200.0070.01813.72
5.3.190.0020.01913.67
5.3.180.0030.02013.71
5.3.170.0030.01713.72
5.3.160.0030.01713.68
5.3.150.0050.01713.66
5.3.140.0020.02313.72
5.3.130.0050.03313.68
5.3.120.0030.02013.66
5.3.110.0030.02113.71
5.3.100.0070.01913.42
5.3.90.0030.01813.40
5.3.80.0030.02213.46
5.3.70.0020.02313.41
5.3.60.0060.01813.37
5.3.50.0050.02213.40
5.3.40.0010.02113.42
5.3.30.0020.02213.29
5.3.20.0000.02613.23
5.3.10.0050.01613.22
5.3.00.0090.01713.23
5.2.170.0030.03011.40
5.2.160.0030.02711.21
5.2.150.0000.03011.18
5.2.140.0100.04711.18
5.2.130.0000.03011.14
5.2.120.0000.03011.18
5.2.110.0070.02011.14
5.2.100.0000.03011.28
5.2.90.0070.02311.05
5.2.80.0030.02711.34
5.2.70.0030.03711.31
5.2.60.0030.02711.16
5.2.50.0070.02711.28
5.2.40.0000.02711.19
5.2.30.0000.03011.22
5.2.20.0030.02711.00
5.2.10.0000.03010.94
5.2.00.0070.02310.95
5.1.60.0000.02710.18
5.1.50.0000.02710.00
5.1.40.0030.02310.17
5.1.30.0000.02710.43
5.1.20.0000.02710.52
5.1.10.0100.01710.27
5.1.00.0070.02010.29
5.0.50.0000.0208.74
5.0.40.0000.0208.64
5.0.30.0000.0338.35
5.0.20.0000.0378.17
5.0.10.0030.0208.40
5.0.00.0000.0638.34
4.4.90.0030.0138.16
4.4.80.0000.0178.16
4.4.70.0000.0178.16
4.4.60.0030.0108.16
4.4.50.0000.0138.16
4.4.40.0000.0238.16
4.4.30.0000.0178.16
4.4.20.0000.0178.16
4.4.10.0030.0178.16
4.4.00.0030.0238.16
4.3.110.0070.0108.16
4.3.100.0000.0308.16
4.3.90.0000.0378.16
4.3.80.0000.0238.16
4.3.70.0030.0338.16
4.3.60.0000.0278.16
4.3.50.0000.0238.16
4.3.40.0000.0278.16
4.3.30.0000.0338.16
4.3.20.0000.0378.16
4.3.10.0000.0278.16
4.3.00.0000.0438.16

preferences:
66.65 ms | 401 KiB | 5 Q