3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 1234.56; // let's print the international format for the en_US locale setlocale(LC_MONETARY, 'en_US'); echo money_format('%i', $number) . "\n"; // USD 1,234.56 // Italian national format with 2 decimals` setlocale(LC_MONETARY, 'it_IT'); echo money_format('%.2n', $number) . "\n"; // Eu 1.234,56 // Using a negative number $number = -1234.5672; // US national format, using () for negative numbers // and 10 digits for left precision setlocale(LC_MONETARY, 'en_US'); echo money_format('%(#10n', $number) . "\n"; // ($ 1,234.57) // Similar format as above, adding the use of 2 digits of right // precision and '*' as a fill character echo money_format('%=*(#10.2n', $number) . "\n"; // ($********1,234.57) // Let's justify to the left, with 14 positions of width, 8 digits of // left precision, 2 of right precision, withouth grouping character // and using the international format for the de_DE locale. setlocale(LC_MONETARY, 'de_DE'); echo money_format('%=*^-14#8.2i', 1234.56) . "\n"; // Eu 1234,56**** // Let's add some blurb before and after the conversion specification setlocale(LC_MONETARY, 'en_GB'); $fmt = 'The final value is %i (after a 10%% discount)'; echo money_format($fmt, 1234.56) . "\n"; // The final value is GBP 1,234.56 (after a 10% discount)

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.0040.01118.93
8.3.50.0140.00622.18
8.3.40.0150.00019.17
8.3.30.0090.00619.50
8.3.20.0070.00020.54
8.3.10.0030.00522.07
8.3.00.0040.00419.52
8.2.180.0130.01018.54
8.2.170.0090.00619.43
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0050.00320.02
8.2.110.0090.00019.71
8.2.100.0060.00618.30
8.2.90.0000.00819.51
8.2.80.0050.00318.00
8.2.70.0030.00617.88
8.2.60.0060.00318.16
8.2.50.0040.00418.07
8.2.40.0090.00020.19
8.2.30.0090.00018.39
8.2.20.0050.00318.14
8.2.10.0070.00018.43
8.2.00.0040.00418.06
8.1.280.0140.00325.92
8.1.270.0030.00519.21
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00623.18
8.1.230.0110.00017.89
8.1.220.0080.00018.03
8.1.210.0040.00418.77
8.1.200.0070.00317.72
8.1.190.0040.00417.50
8.1.180.0040.00418.10
8.1.170.0090.00318.78
8.1.160.0050.00222.39
8.1.150.0000.00719.23
8.1.140.0040.00417.84
8.1.130.0030.00318.29
8.1.120.0000.00717.64
8.1.110.0080.00017.64
8.1.100.0050.00217.73
8.1.90.0050.00317.67
8.1.80.0040.00317.74
8.1.70.0040.00417.80
8.1.60.0000.00917.91
8.1.50.0000.00817.89
8.1.40.0000.00817.83
8.1.30.0000.00817.84
8.1.20.0000.00817.93
8.1.10.0000.00717.99
8.1.00.0030.00617.91
8.0.300.0050.00218.77
8.0.290.0000.00717.13
8.0.280.0000.00818.76
8.0.270.0040.00417.67
8.0.260.0060.00017.70
8.0.250.0000.00817.30
8.0.240.0040.00417.45
8.0.230.0000.00817.40
8.0.220.0030.00317.33
8.0.210.0050.00217.34
8.0.200.0000.00817.40
8.0.190.0000.00917.27
8.0.180.0040.00417.39
8.0.170.0030.00617.27
8.0.160.0040.00417.20
8.0.150.0000.00717.08
8.0.140.0030.00517.24
8.0.130.0000.00613.62
8.0.120.0080.00017.30
8.0.110.0000.00717.22
8.0.100.0050.00217.13
8.0.90.0050.00217.12
8.0.80.0150.00017.23
8.0.70.0030.00417.17
8.0.60.0000.00817.10
8.0.50.0050.00317.22
8.0.30.0170.00717.37
8.0.20.0120.00717.41
8.0.10.0020.00517.19
8.0.00.0130.00617.21
7.4.330.0000.00815.73
7.4.320.0030.00317.03
7.4.300.0040.00416.93
7.4.290.0090.00317.21
7.4.280.0130.00016.96
7.4.270.0050.00517.09
7.4.260.0020.00517.18
7.4.250.0040.00416.98
7.4.240.0040.00317.15
7.4.230.0030.00317.02
7.4.220.0130.00917.23
7.4.210.0120.00917.24
7.4.200.0000.00717.25
7.4.160.0180.00417.10
7.4.150.0090.01617.40
7.4.140.0090.01217.86
7.4.130.0090.01216.87
7.4.120.0060.01217.09
7.4.110.0100.01317.19
7.4.100.0120.00516.96
7.4.90.0170.00016.96
7.4.80.0100.01019.39
7.4.70.0110.00716.98
7.4.60.0100.01017.03
7.4.50.0040.00016.67
7.4.40.0120.00917.06
7.4.30.0080.00817.03
7.4.00.0110.00714.84
7.3.330.0060.00613.75
7.3.320.0030.00313.79
7.3.310.0070.00016.65
7.3.300.0030.00616.70
7.3.290.0130.00816.77
7.3.280.0090.01116.77
7.3.270.0080.01217.40
7.3.260.0080.01216.85
7.3.250.0140.00917.04
7.3.240.0130.00616.78
7.3.230.0100.01317.13
7.3.210.0060.01316.85
7.3.200.0080.01119.39
7.3.190.0080.01416.78
7.3.180.0060.01117.00
7.3.170.0100.00716.73
7.3.160.0070.01316.79
7.3.10.0130.00316.29
7.3.00.0030.01016.53
7.2.330.0030.01617.21
7.2.320.0130.01317.07
7.2.310.0090.01216.89
7.2.300.0100.00716.78
7.2.290.0070.01017.26
7.2.130.0030.01216.63
7.2.120.0090.00616.64
7.2.110.0060.00916.63
7.2.100.0120.00316.55
7.2.90.0040.00816.80
7.2.80.0060.00916.82
7.2.70.0070.01316.86
7.2.60.0170.00716.56
7.2.50.0130.00316.62
7.2.40.0030.00916.79
7.2.30.0090.00016.92
7.2.20.0070.00716.61
7.2.10.0120.00317.03
7.2.00.0100.00518.18
7.1.250.0000.00915.63
7.1.200.0060.00915.81
7.1.100.0080.01117.95
7.1.70.0030.00317.17
7.1.60.0090.01319.46
7.1.50.0070.01516.92
7.1.00.0000.08022.48
7.0.200.0040.00416.55
7.0.140.0000.03721.97
7.0.60.0300.06719.98
7.0.50.0000.04317.84
7.0.40.0000.05019.97
7.0.30.0230.03720.13
7.0.20.0330.07720.19
7.0.10.0030.05720.06
7.0.00.0000.04320.20
5.6.280.0000.07721.13
5.6.210.0100.08020.72
5.6.200.0100.05018.22
5.6.190.0100.04020.58
5.6.180.0370.07020.49
5.6.170.0300.08020.44
5.6.160.0130.07320.51
5.6.150.0100.07318.16
5.6.140.0070.04018.17
5.6.130.0070.07318.18
5.6.120.0070.07321.00
5.6.110.0070.08720.96
5.6.100.0000.07021.04
5.6.90.0100.04720.88
5.6.80.0130.07320.50
5.5.350.0000.04320.48
5.5.340.0070.08317.92
5.5.330.0070.05020.25
5.5.320.0330.04020.23
5.5.310.0330.07320.41
5.5.300.0070.08018.02
5.5.290.0030.04017.98
5.5.280.0070.04720.76
5.5.270.0070.05720.68
5.5.260.0100.08720.86
5.5.250.0100.04320.68
5.5.240.0030.04020.26
5.4.450.0430.08319.42
5.4.440.0300.06019.55
5.4.430.0070.05719.53
5.4.420.0070.06019.54
5.4.410.0100.05319.39
5.4.400.0100.05319.23
5.4.390.0300.06018.69
5.4.380.0170.05718.80
5.4.370.0130.05718.71
5.4.360.0130.05718.56
5.4.350.0200.06018.84
5.4.340.0230.05018.55
5.4.320.0170.06018.71
5.4.310.0030.06318.74
5.4.300.0170.05718.43
5.4.290.0300.03718.65
5.4.280.0170.05718.68
5.4.270.0330.03318.78
5.4.260.0100.06718.46
5.4.250.0100.06318.65
5.4.240.0130.05718.82
5.4.230.0230.05018.54
5.4.220.0300.05318.72
5.4.210.0100.05718.55
5.4.200.0130.05316.61
5.4.190.0300.03718.57
5.4.180.0270.06018.68
5.4.170.0200.04718.63
5.4.160.0130.05718.56
5.4.150.0270.04718.72
5.4.140.0230.04716.18
5.4.130.0230.04316.29
5.4.120.0230.04316.25
5.4.110.0230.04016.39
5.4.100.0130.05716.23
5.4.90.0170.05316.33
5.4.80.0100.05716.27
5.4.70.0230.04316.17
5.4.60.0170.05316.21
5.4.50.0200.05716.21
5.4.40.0330.05716.17
5.4.30.0200.05316.43
5.4.20.0200.05316.24
5.4.10.0170.05316.30
5.4.00.0170.05015.92
5.3.290.0300.06014.64
5.3.280.0170.05314.57
5.3.270.0330.06014.65
5.3.260.0170.07714.77
5.3.250.0270.04714.70
5.3.240.0370.05714.64
5.3.230.0270.04314.65
5.3.220.0100.05714.61
5.3.210.0200.05714.62
5.3.200.0130.06314.58
5.3.190.0200.05314.67
5.3.180.0200.05014.64
5.3.170.0200.05014.66
5.3.160.0130.05314.61
5.3.150.0100.06314.63
5.3.140.0130.05714.53
5.3.130.0200.05014.56
5.3.120.0100.06014.68
5.3.110.0130.06014.73
5.3.100.0170.07014.09
5.3.90.0170.05314.04
5.3.80.0070.06314.20
5.3.70.0230.05714.12
5.3.60.0130.05314.00
5.3.50.0200.04714.13
5.3.40.0170.05014.00
5.3.30.0200.05313.91
5.3.20.0170.04713.86
5.3.10.0170.04713.70
5.3.00.0070.06013.78
5.2.170.0070.04711.14
5.2.160.0170.03711.16
5.2.150.0130.04011.13
5.2.140.0130.04011.32
5.2.130.0230.03011.29
5.2.120.0200.03311.14
5.2.110.0200.05011.21
5.2.100.0100.04711.21
5.2.90.0100.04311.25
5.2.80.0070.04711.08
5.2.70.0130.04711.27
5.2.60.0100.04711.09
5.2.50.0200.05011.15
5.2.40.0100.04011.13
5.2.30.0200.04711.07
5.2.20.0170.04311.09
5.2.10.0130.03710.85
5.2.00.0200.03710.75
5.1.60.0130.03010.13
5.1.50.0100.03710.18
5.1.40.0130.04010.11
5.1.30.0170.03310.38
5.1.20.0100.04010.34
5.1.10.0070.04010.13
5.1.00.0130.03010.20
5.0.50.0100.0278.59
5.0.40.0100.0238.41
5.0.30.0100.0478.22
5.0.20.0130.0238.29
5.0.10.0100.0278.18
5.0.00.0130.0378.18
4.4.90.0070.0235.93
4.4.80.0030.0275.85
4.4.70.0070.0275.89
4.4.60.0070.0235.88
4.4.50.0030.0235.88
4.4.40.0070.0375.86
4.4.30.0100.0175.90
4.4.20.0000.0275.91
4.4.10.0000.0275.97
4.4.00.0100.0305.91
4.3.110.0030.0235.81
4.3.100.0130.0135.83
4.3.90.0070.0205.87
4.3.80.0070.0335.78
4.3.70.0000.0275.81
4.3.60.0070.0205.93
4.3.50.0070.0205.83
4.3.40.0070.0335.79
4.3.30.0100.0204.79
4.3.20.0030.0234.79
4.3.10.0000.0274.79
4.3.00.0100.02312.55

preferences:
48.84 ms | 401 KiB | 5 Q