3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "$20,000 AUD", "$20,000", "20,000 AUD", "$", "20,000", "AUD" ]; $re = '/(?P<symbol>[$¥£€₹])(?P<amount>\d{1,10}(?:[.,]\d{1,10})?)(?:\h+(?P<currency>AUD|USD|GBP|EURO?S?)\b)?\b|(?P<amount>\d{1,10}(?:[.,]\d{1,10})?)\h+(?P<currency>AUD|USD|GBP|EURO?S?)\b/J'; foreach ($strings as $s) { $m = preg_match($re, $s, $matches); if ($m) { print_r($matches); } }

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.5.00.0150.01020.08
8.4.150.0020.00014.05
8.4.140.0130.00917.52
8.4.130.0130.00818.95
8.4.120.0100.01024.11
8.4.110.0030.00518.85
8.4.100.0030.00618.88
8.4.90.0090.00822.45
8.4.80.0120.00817.75
8.4.70.0120.01019.84
8.4.60.0120.00619.12
8.4.50.0050.00418.66
8.4.40.0140.00717.93
8.4.30.0070.00320.54
8.4.20.0200.00018.07
8.4.10.0120.00619.87
8.3.280.0100.01118.41
8.3.270.0120.01016.71
8.3.260.0120.00716.63
8.3.250.0110.00819.13
8.3.240.0130.00518.80
8.3.230.0060.00216.55
8.3.220.0130.00918.83
8.3.210.0090.01016.85
8.3.200.0030.00616.89
8.3.190.0120.00717.21
8.3.180.0090.01018.98
8.3.170.0070.00722.61
8.3.160.0120.00619.22
8.3.150.0070.01117.45
8.3.140.0040.01517.24
8.3.130.0080.00018.63
8.3.120.0130.00619.03
8.3.110.0040.00420.94
8.3.100.0100.00018.44
8.3.90.0080.00026.77
8.3.80.0060.00319.36
8.3.70.0090.00916.88
8.3.60.0090.00616.63
8.3.50.0150.00316.56
8.3.40.0180.00018.77
8.3.30.0070.00718.83
8.3.20.0000.00824.18
8.3.10.0060.00324.66
8.3.00.0090.00026.16
8.2.290.0110.00820.54
8.2.280.0100.00920.23
8.2.270.0040.01116.95
8.2.260.0120.00617.05
8.2.250.0040.01418.57
8.2.240.0000.00917.47
8.2.230.0030.00622.58
8.2.220.0050.00316.75
8.2.210.0080.00026.77
8.2.200.0030.00718.88
8.2.190.0000.01618.30
8.2.180.0110.00725.92
8.2.170.0040.01118.83
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0050.00326.35
8.2.110.0060.00322.20
8.2.100.0040.00917.84
8.2.90.0030.00517.97
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0080.00018.03
8.2.50.0060.00318.07
8.2.40.0040.00418.10
8.2.30.0050.00318.21
8.2.20.0040.00418.20
8.2.10.0000.00719.42
8.2.00.0000.00719.36
8.1.330.0080.01022.21
8.1.320.0110.00918.09
8.1.310.0040.00418.57
8.1.300.0000.01018.11
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0060.00324.04
8.1.260.0090.00028.09
8.1.250.0000.00728.09
8.1.240.0110.00022.59
8.1.230.0110.00022.66
8.1.220.0040.00417.78
8.1.210.0000.00818.82
8.1.200.0060.00317.48
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0040.00418.77
8.1.160.0080.00019.03
8.1.150.0040.00419.00
8.1.140.0000.00718.89
8.1.130.0030.00320.09
8.1.120.0020.00517.59
8.1.110.0000.00817.66
8.1.100.0040.00417.54
8.1.90.0030.00517.62
8.1.80.0040.00717.48
8.1.70.0040.00417.65
8.1.60.0080.00017.64
8.1.50.0050.00317.56
8.1.40.0080.00017.58
8.1.30.0040.00717.71
8.1.20.0030.00517.75
8.1.10.0050.00317.64
8.1.00.0060.00317.52
8.0.300.0070.00019.98
8.0.290.0000.00716.75
8.0.280.0030.00318.54
8.0.270.0050.00218.23
8.0.260.0030.00318.39
8.0.250.0040.00417.05
8.0.240.0030.00317.00
8.0.230.0000.00717.17
8.0.220.0030.00317.11
8.0.210.0000.00816.97
8.0.200.0000.00717.11
8.0.190.0030.00517.07
8.0.180.0040.00416.93
8.0.170.0000.00917.06
8.0.160.0030.00317.04
8.0.150.0060.00317.00
8.0.140.0080.00016.99
8.0.130.0000.00713.47
8.0.120.0060.00317.02
8.0.110.0000.00817.14
8.0.100.0040.00417.18
8.0.90.0030.00517.15
8.0.80.0100.00817.09
8.0.70.0000.00717.07
8.0.60.0000.00717.04
8.0.50.0000.00717.08
8.0.30.0100.01017.09
8.0.20.0100.00617.23
8.0.10.0030.01317.12
8.0.00.0120.01217.16
7.4.330.0000.00515.55
7.4.320.0070.00016.77
7.4.300.0040.00416.97
7.4.290.0050.00316.59
7.4.280.0040.00416.90
7.4.270.0050.00316.87
7.4.260.0040.00413.57
7.4.250.0070.00016.76
7.4.240.0070.00016.84
7.4.230.0070.00016.70
7.4.220.0040.00416.78
7.4.210.0060.01216.77
7.4.200.0000.00716.99
7.4.160.0000.01616.92
7.4.150.0080.00816.73
7.4.140.0060.00916.73
7.4.130.0060.01516.81
7.4.120.0110.00416.73
7.4.110.0130.00316.77
7.4.100.0030.01216.77
7.4.90.0130.01016.91
7.4.80.0120.00416.86
7.4.70.0060.00916.77
7.4.60.0130.00316.68
7.4.50.0060.01516.64
7.4.40.0090.01116.76
7.4.30.0060.01016.64
7.4.20.0030.01216.69
7.4.10.0080.00816.64
7.4.00.0100.01416.61
7.3.330.0000.00716.57
7.3.320.0030.00313.34
7.3.310.0000.00716.41
7.3.300.0070.00016.45
7.3.290.0040.00416.41
7.3.270.0030.01316.36
7.3.260.0140.00416.45
7.3.250.0060.00916.45
7.3.240.0070.00716.39
7.3.230.0150.00616.52
7.3.220.0040.01116.35
7.3.210.0030.01116.41
7.3.200.0030.01316.35
7.3.190.0070.00716.39
7.3.180.0090.00616.34
7.3.170.0110.00416.35
7.3.160.0120.00616.39
7.3.150.0110.00716.43
7.3.140.0060.00916.42
7.3.130.0040.01716.32
7.3.120.0030.01816.35
7.3.110.0060.01216.32
7.3.100.0130.00616.24
7.3.90.0070.01516.66
7.3.80.0130.00916.44
7.3.70.0140.00716.55
7.3.60.0100.01016.58
7.3.50.0090.01216.48
7.3.40.0060.01516.51
7.3.30.0070.01116.42
7.3.20.0100.01016.53
7.3.10.0720.00916.47
7.3.00.0030.01316.57

preferences:
186.25 ms | 403 KiB | 5 Q