3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $wildcard = '*'; $urlParts = array( 'path' => 'example.com/sub/path/wildcard/*/sub' ); $patternParts = explode($wildcard, $urlParts['path']); foreach ($patternParts as &$pPart) { $pPart = preg_quote($pPart, '/'); } unset($pPart); var_dump($patternParts); //Случай, когда * находится в конце строки - возможны любые вложенные пути if ($patternParts[count($patternParts)-1] == '') { array_pop($patternParts); if (count($patternParts) > 1) { $pattern = implode('\w+', $patternParts); } else { $pattern = $patternParts[0]; } $pattern.= '[\w\/]+'; } else { $pattern = implode('\w+', $patternParts); } $pattern = '/^' . $pattern . '$/im'; var_dump($pattern);

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.0140.00316.38
8.3.50.0070.00817.25
8.3.40.0120.00318.69
8.3.30.0150.00618.76
8.3.20.0030.00618.80
8.3.10.0040.00420.48
8.3.00.0080.00019.51
8.2.180.0150.00316.50
8.2.170.0120.00322.96
8.2.160.0100.00322.26
8.2.150.0110.00424.18
8.2.140.0080.00024.66
8.2.130.0100.00326.16
8.2.120.0050.00219.71
8.2.110.0030.00620.77
8.2.100.0080.00417.91
8.2.90.0040.00419.38
8.2.80.0050.00219.42
8.2.70.0080.00017.63
8.2.60.0040.00417.91
8.2.50.0050.00518.07
8.2.40.0040.00418.15
8.2.30.0030.00518.18
8.2.20.0040.00417.66
8.2.10.0090.00017.62
8.2.00.0000.00817.80
8.1.280.0120.00925.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0000.01120.97
8.1.220.0060.00317.75
8.1.210.0060.00318.96
8.1.200.0000.00917.35
8.1.190.0040.00417.53
8.1.180.0060.00318.10
8.1.170.0040.00418.91
8.1.160.0000.00718.89
8.1.150.0040.00418.64
8.1.140.0080.00017.32
8.1.130.0000.00717.82
8.1.120.0000.00817.45
8.1.110.0080.00017.41
8.1.100.0070.00017.45
8.1.90.0040.00417.44
8.1.80.0040.00417.35
8.1.70.0000.00717.39
8.1.60.0000.00817.48
8.1.50.0050.00217.48
8.1.40.0000.00817.50
8.1.30.0060.00317.54
8.1.20.0080.00017.54
8.1.10.0060.00317.48
8.1.00.0000.00717.39
8.0.300.0000.00719.94
8.0.290.0040.00416.75
8.0.280.0030.00318.50
8.0.270.0000.00717.25
8.0.260.0070.00016.73
8.0.250.0050.00316.99
8.0.240.0000.01016.93
8.0.230.0030.00316.84
8.0.220.0000.00716.84
8.0.210.0030.00316.84
8.0.200.0000.00816.86
8.0.190.0000.00716.94
8.0.180.0050.00216.97
8.0.170.0040.00416.93
8.0.160.0060.00316.98
8.0.150.0000.00816.88
8.0.140.0070.00416.80
8.0.130.0030.00313.28
8.0.120.0030.00616.77
8.0.110.0050.00216.88
8.0.100.0070.00016.79
8.0.90.0000.00716.93
8.0.80.0100.00716.82
8.0.70.0000.00816.94
8.0.60.0040.00416.69
8.0.50.0040.00416.76
8.0.30.0060.01216.89
8.0.20.0140.00817.05
8.0.10.0080.00016.92
8.0.00.0160.00316.76
7.4.330.0030.00312.98
7.4.320.0030.00316.61
7.4.300.0030.00316.61
7.4.290.0070.00016.52
7.4.280.0030.00616.41
7.4.270.0000.00716.45
7.4.260.0030.00313.24
7.4.250.0030.00616.44
7.4.240.0000.00716.65
7.4.230.0000.00816.36
7.4.220.0060.01016.64
7.4.210.0100.00616.60
7.4.200.0000.00716.63
7.4.190.0030.00316.64
7.4.160.0030.01316.43
7.4.150.0090.00916.55
7.4.140.0100.01016.44
7.4.130.0060.01016.54
7.4.120.0130.00616.46
7.4.110.0110.00616.50
7.4.100.0100.00716.54
7.4.90.0110.00816.34
7.4.80.0070.01016.61
7.4.70.0080.00816.37
7.4.60.0120.00316.35
7.4.50.0000.00916.63
7.4.40.0030.01016.36
7.4.30.0110.01116.29
7.4.00.0030.01015.01
7.3.330.0000.00613.10
7.3.320.0000.00513.16
7.3.310.0030.00316.46
7.3.300.0030.00316.36
7.3.290.0070.00716.28
7.3.280.0070.00916.27
7.3.270.0100.01916.57
7.3.260.0120.00516.53
7.3.250.0130.00816.49
7.3.240.0090.00616.50
7.3.230.0070.01116.56
7.3.210.0110.00716.54
7.3.200.0110.01119.39
7.3.190.0080.01216.32
7.3.180.0100.01016.50
7.3.170.0060.01316.45
7.3.160.0000.01616.47
7.3.120.0030.01214.95
7.2.330.0160.00016.40
7.2.320.0040.01516.59
7.2.310.0110.01416.61
7.2.300.0090.00616.61
7.2.290.0110.00616.74
7.2.00.0030.00919.57
7.1.100.0040.01118.04
7.1.70.0070.00017.18
7.1.60.0170.00719.40
7.1.50.0170.01734.92
7.1.00.0030.05322.51
7.0.200.0000.00816.68
7.0.140.0000.07022.05
7.0.120.0070.07322.15
7.0.60.0100.03719.92
7.0.50.0070.03717.89
7.0.40.0030.04320.08
7.0.30.0270.08020.33
7.0.20.0170.04020.13
7.0.10.0330.05320.04
7.0.00.0100.08020.01
5.6.280.0000.07720.86
5.6.210.0070.06720.53
5.6.200.0030.04018.18
5.6.190.0170.04020.64
5.6.180.0300.07720.67
5.6.170.0200.07020.41
5.6.160.0070.07320.61
5.6.150.0030.07718.18
5.6.140.0070.06718.21
5.6.130.0100.06018.16
5.6.120.0100.08020.98
5.6.110.0030.08721.07
5.6.100.0030.08721.02
5.6.90.0030.09721.12
5.6.80.0130.05020.39
5.6.70.4030.03720.34
5.5.350.0300.04720.43
5.5.340.0070.03717.98
5.5.330.0070.03720.20
5.5.320.0100.07720.44
5.5.310.0330.07020.32
5.5.300.0070.04017.96
5.5.290.0030.05317.91
5.5.280.0130.07720.65
5.5.270.0130.07320.89
5.5.260.0170.07320.71
5.5.250.0000.04320.77
5.5.240.0100.06020.15
5.4.450.0100.04719.33
5.4.440.0070.03719.48
5.4.430.0070.05019.16
5.4.420.0030.04319.46
5.4.410.0070.07319.11
5.4.400.0130.06718.81
5.4.390.0070.06718.79
5.4.380.0100.07719.18
5.4.370.0030.07719.14
5.4.360.0070.07019.13
5.4.350.0030.08318.81
5.4.340.0000.05018.92
5.4.320.0030.04318.79
5.4.310.0070.05719.08
5.4.300.0030.05719.15
5.4.290.0070.04319.11
5.4.280.0100.06719.14
5.4.270.0100.04019.17
5.4.260.0070.06719.00
5.4.250.0100.04319.07
5.4.240.0100.04018.82
5.4.230.0100.05318.79
5.4.220.0100.05719.11
5.4.210.0100.07019.17
5.4.200.0070.04719.08
5.4.190.0030.05018.78
5.4.180.0070.06018.86
5.4.170.0070.03719.07
5.4.160.0030.03718.76
5.4.150.0000.04018.78
5.4.140.0030.03316.48
5.4.130.0000.04016.20
5.4.120.0000.03716.49
5.4.110.0030.03716.41
5.4.100.0200.03016.26
5.4.90.0070.03016.26
5.4.80.0000.04316.39
5.4.70.0000.03716.23
5.4.60.0000.03716.35
5.4.50.0030.03716.28
5.4.40.0030.03316.23
5.4.30.0030.03316.25
5.4.20.0130.02716.38
5.4.10.0070.03016.38
5.4.00.0070.03315.71
5.3.290.0070.04714.48
5.3.280.0100.04014.51
5.3.270.0100.04314.57
5.3.260.0000.04014.53
5.3.250.0030.03714.58
5.3.240.0000.04014.56
5.3.230.0030.03714.52
5.3.220.0000.03714.49
5.3.210.0000.04014.54
5.3.200.0000.04314.50
5.3.190.0100.03014.49
5.3.180.0000.03714.48
5.3.170.0100.03014.50
5.3.160.0000.04014.53
5.3.150.0030.03714.46
5.3.140.0000.03714.53
5.3.130.0000.04714.48
5.3.120.0030.03714.48
5.3.110.0100.03714.64
5.3.100.0000.03714.12
5.3.90.0070.03013.94
5.3.80.0030.03713.95
5.3.70.0000.05313.98
5.3.60.0030.04313.84
5.3.50.0000.03713.88
5.3.40.0100.03013.93
5.3.30.0030.03313.73
5.3.20.0000.03713.66
5.3.10.0030.03313.59
5.3.00.0000.03713.57
5.2.170.0030.02711.13
5.2.160.0000.03011.13
5.2.150.0000.03011.16
5.2.140.0030.02711.07
5.2.130.0030.03011.04
5.2.120.0000.03011.09
5.2.110.0030.03011.04
5.2.100.0000.03310.95
5.2.90.0070.02710.95
5.2.80.0000.03010.95
5.2.70.0000.03011.00
5.2.60.0030.02711.04
5.2.50.0000.03310.87
5.2.40.0030.02711.15
5.2.30.0030.05310.97
5.2.20.0070.03010.95
5.2.10.0030.05710.71
5.2.00.0030.06310.74
5.1.60.0030.0339.89
5.1.50.0000.0579.97
5.1.40.0100.02010.04
5.1.30.0030.03010.37
5.1.20.0000.03310.23
5.1.10.0000.04310.06
5.1.00.0000.0339.97
5.0.50.0030.0338.46
5.0.40.0130.0408.32
5.0.30.0100.0508.14
5.0.20.0070.0278.22
5.0.10.0000.0278.20
5.0.00.0100.0578.07
4.4.90.0030.0137.85
4.4.80.0030.0107.85
4.4.70.0100.0237.85
4.4.60.0030.0337.85
4.4.50.0030.0137.85
4.4.40.0030.0307.85
4.4.30.0000.0237.85
4.4.20.0000.0407.85
4.4.10.0000.0177.85
4.4.00.0070.0407.85
4.3.110.0030.0377.85
4.3.100.0030.0337.85
4.3.90.0070.0277.85
4.3.80.0000.0237.85
4.3.70.0030.0307.85
4.3.60.0030.0137.85
4.3.50.0030.0307.85
4.3.40.0100.0277.85
4.3.30.0000.0237.85
4.3.20.0030.0337.85
4.3.10.0000.0177.85
4.3.00.0000.0177.85

preferences:
42.78 ms | 400 KiB | 5 Q