3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$s = "--included-- in package price: 5 % vat aed 10.00 destination fee per night 2 % municipality fee 3.5 % packaging fee 10 % warranty service charge breakfast"; $s = "--included-- in product price: breakfast --excluded--: 5 % vat aed 10.00 destination fee per night 2 % municipality fee 3.5 % packaging fee 10 % warranty service charge"; $results = []; if (preg_match_all('~(--(?:(?:not )?in|ex)cluded--)(?:\s+([a-zA-Z ]+))?:+\s*((?:(?!--(?:(?:not )?in|ex)cluded--).)*)~su', $s, $m, PREG_SET_ORDER, 0)) { foreach ($m as $v) { $lastline=array_pop($v); // Remove last item //print_r($details); if (preg_match_all('~(?:(\b(?:usd|aed|mad|usd)\b|\B€|\bus\$)\s*)?\d+(?:\.\d+)?(?:(?!(?1))\D)*~u', $lastline, $details)) { $results[] = array_merge($v, $details[0]); } else { $results[] = $v; } } //[3] => 5 % vat aed [4] => 10.00 destination fee per night //[3] => 5 % vat [4] => aed 10.00 destination fee per night } print_r($results);

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.130.0030.00618.80
8.3.120.0100.00619.05
8.3.110.0120.00620.94
8.3.100.0000.00824.06
8.3.90.0040.00426.77
8.3.80.0030.00617.05
8.3.70.0110.00718.93
8.3.60.0110.00418.41
8.3.50.0070.00717.73
8.3.40.0030.01218.92
8.3.30.0070.00719.10
8.3.20.0050.00320.83
8.3.10.0040.00421.85
8.3.00.0040.00422.36
8.2.250.0000.01116.78
8.2.240.0000.00917.18
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0120.00326.77
8.2.200.0060.00316.75
8.2.190.0040.01416.75
8.2.180.0150.00616.75
8.2.170.0090.01322.96
8.2.160.0110.00322.17
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0030.00721.07
8.2.110.0100.00021.18
8.2.100.0040.00818.09
8.2.90.0000.00920.42
8.2.80.0030.00518.03
8.2.70.0000.00818.05
8.2.60.0000.00818.28
8.2.50.0000.00818.10
8.2.40.0060.00319.55
8.2.30.0050.00219.52
8.2.20.0070.00018.30
8.2.10.0040.00419.41
8.2.00.0040.00419.50
8.1.300.0080.00018.35
8.1.290.0030.00930.84
8.1.280.0150.00625.92
8.1.270.0030.00620.95
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0160.00623.80
8.1.230.0040.00822.65
8.1.220.0000.00818.04
8.1.210.0070.00319.10
8.1.200.0060.00317.60
8.1.190.0040.00417.48
8.1.180.0080.00018.10
8.1.170.0080.00020.67
8.1.160.0000.00719.12
8.1.150.0040.00418.88
8.1.140.0080.00020.94
8.1.130.0000.00720.14
8.1.120.0020.00517.68
8.1.110.0030.00717.70
8.1.100.0040.00417.62
8.1.90.0040.00417.54
8.1.80.0040.00417.55
8.1.70.0040.00417.56
8.1.60.0030.00617.74
8.1.50.0060.00617.61
8.1.40.0090.00017.70
8.1.30.0060.00317.87
8.1.20.0000.00817.88
8.1.10.0090.00017.69
8.1.00.0090.00017.77
8.0.300.0050.00320.02
8.0.290.0040.00417.00
8.0.280.0050.00218.52
8.0.270.0000.00716.97
8.0.260.0000.00618.48
8.0.250.0040.00417.17
8.0.240.0030.00317.13
8.0.230.0030.00317.20
8.0.220.0000.00717.19
8.0.210.0000.00817.09
8.0.200.0050.00317.21
8.0.190.0040.00417.22
8.0.180.0030.00517.13
8.0.170.0000.00817.13
8.0.160.0030.00617.10
8.0.150.0040.00416.96
8.0.140.0070.00317.13
8.0.130.0030.00513.52
8.0.120.0000.00817.19
8.0.110.0050.00217.00
8.0.100.0000.00717.23
8.0.90.0030.00617.07
8.0.80.0070.01517.09
8.0.70.0080.00017.15
8.0.60.0070.00017.23
8.0.50.0000.00717.07
8.0.30.0070.01017.41
8.0.20.0150.00717.02
8.0.10.0030.00517.36
8.0.00.0110.00717.02
7.4.330.0030.00315.55
7.4.320.0030.00316.82
7.4.300.0000.00716.71
7.4.290.0030.00316.84
7.4.280.0000.00816.82
7.4.270.0070.00016.92
7.4.260.0030.00316.67
7.4.250.0000.00716.90
7.4.240.0060.00216.81
7.4.230.0050.00216.82
7.4.220.0060.00216.76
7.4.210.0090.01116.94
7.4.200.0000.00816.76
7.4.130.0100.00716.77
7.4.120.0120.00916.87
7.4.110.0160.00616.76
7.4.100.0090.00916.75
7.4.90.0030.01316.76
7.4.80.0110.00719.39
7.4.70.0120.00616.87
7.4.60.0140.00316.68
7.4.50.0060.00916.72
7.4.40.0070.01116.93
7.4.00.0030.01615.49
7.3.330.0050.00316.46
7.3.320.0050.00013.49
7.3.310.0080.00016.71
7.3.300.0030.00316.56
7.3.290.0000.00816.47
7.3.280.0070.00416.68
7.3.260.0110.00816.65
7.3.240.0140.00516.68
7.3.230.0130.00616.60
7.3.210.0150.00316.53
7.3.200.0110.00716.68
7.3.190.0120.00616.74
7.3.180.0090.00616.48
7.3.170.0080.00816.60
7.3.160.0070.01116.70
7.3.120.0000.01815.12
7.3.110.0080.00815.08
7.3.100.0010.01214.93
7.3.90.0120.00615.09
7.3.80.0060.00815.12
7.3.70.0120.00614.97
7.3.60.0050.01115.02
7.3.50.0070.00415.14
7.3.40.0030.01014.88
7.3.30.0050.00814.98
7.3.20.0060.00615.84
7.3.10.0020.01215.98
7.3.00.0070.00616.03
7.2.330.0070.01117.00
7.2.320.0090.00916.90
7.2.310.0100.00716.79
7.2.300.0140.00516.80
7.2.290.0030.01316.91
7.2.240.0070.00715.35
7.2.230.0070.01015.24
7.2.220.0110.00515.25
7.2.210.0030.01215.24
7.2.200.0050.01115.09
7.2.190.0070.00715.16
7.2.180.0060.00915.29
7.2.170.0110.00715.29
7.2.160.0090.00515.12
7.2.150.0090.00616.07
7.2.140.0110.00316.19
7.2.130.0090.01016.13
7.2.120.0070.00715.97
7.2.110.0080.00916.16
7.2.100.0090.00916.31
7.2.90.0090.00716.18
7.2.80.0130.00516.13
7.2.70.0070.00516.13
7.2.60.0080.01016.25
7.2.50.0030.01216.31
7.2.40.0070.01216.24
7.2.30.0110.00716.09
7.2.20.0070.00816.13
7.2.10.0050.01016.29
7.2.00.0060.00916.13
7.1.330.0080.00416.05
7.1.320.0100.00715.04
7.1.310.0040.01115.29
7.1.300.0090.00715.08
7.1.290.0030.01114.96
7.1.280.0090.00815.09
7.1.270.0100.00515.09
7.1.260.0070.00414.93
7.1.250.0050.00915.16

preferences:
63.48 ms | 403 KiB | 5 Q