3v4l.org

run code in 300+ PHP versions simultaneously
<?php $formatter = new \NumberFormatter('de_CH', \NumberFormatter::CURRENCY); $format = $formatter->getPattern(); #$decimalSymbol = $formatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); #$groupSymbol = $formatter->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL); #echo $format . ' ' . $decimalSymbol . ' ' . $groupSymbol; $r = form($format); var_dump($r); function form($format) { $pos = strpos($format, ';'); if ($pos !== false) { $format = substr($format, 0, $pos); } $format = preg_replace("/[^0\#\.,]/", "", $format); $totalPrecision = 0; $decimalPoint = strpos($format, '.'); if ($decimalPoint !== false) { $totalPrecision = strlen($format) - (strrpos($format, '.') + 1); } else { $decimalPoint = strlen($format); } $requiredPrecision = $totalPrecision; $t = substr($format, $decimalPoint); $pos = strpos($t, '#'); if ($pos !== false) { $requiredPrecision = strlen($t) - $pos - $totalPrecision; } if (strrpos($format, ',') !== false) { $group = $decimalPoint - strrpos($format, ',') - 1; } else { $group = strrpos($format, '.'); } $integerRequired = strpos($format, '.') - strpos($format, '0'); return [ 'precision' => $totalPrecision, 'requiredPrecision' => $requiredPrecision, 'group' => $group, 'integerRequired' => $integerRequired ]; }

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.0180.00418.62
8.3.60.0130.00320.43
8.3.50.0110.00818.61
8.3.40.0060.00920.43
8.3.30.0060.01020.38
8.3.20.0030.00521.64
8.3.10.0040.00423.55
8.3.00.0050.00322.64
8.2.180.0090.01320.54
8.2.170.0060.00922.96
8.2.160.0070.00723.83
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00023.55
8.2.120.0060.00326.35
8.2.110.0030.00622.14
8.2.100.0080.00420.03
8.2.90.0080.00020.86
8.2.80.0080.00019.65
8.2.70.0000.00919.88
8.2.60.0050.00320.05
8.2.50.0000.00820.03
8.2.40.0060.00323.93
8.2.30.0080.00022.51
8.2.20.0030.00520.21
8.2.10.0000.01019.96
8.2.00.0030.00519.93
8.1.280.0070.01525.92
8.1.270.0050.00325.64
8.1.260.0040.00426.35
8.1.250.0120.00328.09
8.1.240.0040.00725.27
8.1.230.0070.00621.09
8.1.220.0000.00919.66
8.1.210.0060.00319.25
8.1.200.0000.01019.35
8.1.190.0000.01019.35
8.1.180.0000.00919.41
8.1.170.0040.00420.76
8.1.160.0000.00920.65
8.1.150.0040.00422.17
8.1.140.0080.00021.46
8.1.130.0040.00420.38
8.1.120.0040.00719.69
8.1.110.0030.00519.63
8.1.100.0000.00819.65
8.1.90.0040.00419.56
8.1.80.0030.00619.65
8.1.70.0000.00819.49
8.1.60.0000.00819.80
8.1.50.0030.00519.75
8.1.40.0030.00619.55
8.1.30.0040.00419.88
8.1.20.0060.00319.81
8.1.10.0050.00319.74
8.1.00.0050.00319.66
8.0.300.0040.00419.77
8.0.290.0080.00018.75
8.0.280.0000.00819.98
8.0.270.0000.00719.23
8.0.260.0030.00518.92
8.0.250.0040.00418.97
8.0.240.0000.00918.95
8.0.230.0030.00518.99
8.0.220.0050.00318.81
8.0.210.0000.00719.02
8.0.200.0040.00419.13
8.0.190.0050.00519.08
8.0.180.0060.00619.19
8.0.170.0000.00718.80
8.0.160.0030.00518.92
8.0.150.0040.00418.66
8.0.140.0040.00419.04
8.0.130.0020.00513.28
8.0.120.0050.00319.00
8.0.110.0030.00618.95
8.0.100.0040.00419.14
8.0.90.0060.00319.04
8.0.80.0070.01119.02
8.0.70.0080.00018.81
8.0.60.0040.00419.02
8.0.50.0030.00519.11
8.0.30.0100.01219.34
8.0.20.0070.01219.45
8.0.10.0040.00419.19
8.0.00.0030.01619.16
7.4.330.0060.00015.55
7.4.320.0000.00718.84
7.4.300.0030.00318.80
7.4.290.0040.00418.74
7.4.280.0050.00318.68
7.4.270.0040.00418.84
7.4.260.0050.00218.82
7.4.250.0050.00318.72
7.4.240.0030.00518.71
7.4.230.0040.00418.57
7.4.220.0130.00718.94
7.4.210.0120.00918.94
7.4.200.0070.00018.74
7.4.160.0070.01018.80
7.4.150.0090.01518.66
7.4.140.0100.00918.71
7.4.130.0160.00618.79
7.4.120.0080.01318.63
7.4.110.0190.00618.59
7.4.100.0160.00618.89
7.4.90.0110.00618.52
7.4.80.0070.01819.39
7.4.70.0140.00518.73
7.4.60.0040.01618.59
7.4.50.0030.00918.61
7.4.40.0120.00618.61
7.4.30.0100.00718.63
7.4.00.0050.01117.19
7.3.330.0030.00313.23
7.3.320.0030.00313.24
7.3.310.0030.00518.63
7.3.300.0030.00318.51
7.3.290.0130.00918.59
7.3.280.0090.00918.61
7.3.270.0090.00919.01
7.3.260.0140.00818.62
7.3.250.0090.01418.73
7.3.240.0100.00718.92
7.3.230.0090.00918.78
7.3.210.0170.00018.59
7.3.200.0120.00618.60
7.3.190.0090.01018.56
7.3.180.0060.01218.85
7.3.170.0050.01318.69
7.3.160.0140.00418.66
7.3.120.0100.01017.30
7.3.110.0110.01117.20
7.3.100.0000.01417.10
7.3.90.0060.00617.20
7.3.80.0040.01117.14
7.3.70.0000.01117.08
7.3.60.0060.01017.33
7.3.50.0000.00917.05
7.3.40.0030.01017.20
7.3.30.0100.00316.95
7.3.20.0110.00418.86
7.3.10.0070.00718.81
7.3.00.0060.00919.01
7.2.330.0150.00418.93
7.2.320.0170.00319.00
7.2.310.0140.00418.99
7.2.300.0200.00718.56
7.2.290.0150.00618.68
7.2.250.0150.00317.52
7.2.240.0070.01417.24
7.2.230.0060.01317.34
7.2.220.0090.00917.26
7.2.210.0100.00317.32
7.2.200.0040.01117.21
7.2.190.0030.01217.52
7.2.180.0040.00817.45
7.2.170.0000.01017.31
7.2.60.0150.01619.04
7.2.00.0060.00922.19
7.1.330.0110.00418.07
7.1.320.0030.01318.02
7.1.310.0060.00317.80
7.1.300.0030.01017.89
7.1.290.0090.00617.52
7.1.280.0100.00318.09
7.1.270.0030.01017.60
7.1.260.0030.00917.84
7.1.200.0000.01318.08
7.1.100.0540.01520.35
7.1.70.0120.00619.43
7.1.60.0770.02035.82
7.1.50.0670.00735.62
7.1.40.0500.02035.06
7.1.30.0470.02035.43
7.1.20.0570.01035.51
7.1.10.0300.01317.30
7.1.00.0400.00717.06
7.0.200.0600.01017.35
7.0.190.0400.01017.27
7.0.180.0470.01716.95
7.0.170.0530.01017.01
7.0.160.0500.00716.79
7.0.150.0300.01017.01
7.0.140.0400.00316.94
7.0.130.0500.01316.81
7.0.120.0530.01016.82
7.0.110.0830.01016.79
7.0.100.0300.01016.73
7.0.90.0330.01016.66
7.0.80.0270.01316.90
7.0.70.0300.01016.56
7.0.60.0330.01016.50
7.0.50.0300.01016.47
7.0.40.0400.00316.75
7.0.30.0330.01016.88
7.0.20.0300.01016.67
7.0.10.0370.00716.69
7.0.00.0330.00716.51

preferences:
29.85 ms | 401 KiB | 5 Q