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/*' ); $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.0150.00616.75
8.3.50.0110.00717.34
8.3.40.0130.01018.79
8.3.30.0110.00418.51
8.3.20.0060.00318.96
8.3.10.0160.00320.52
8.3.00.0030.00519.34
8.2.180.0070.01416.63
8.2.170.0040.01122.96
8.2.160.0130.00621.02
8.2.150.0090.00024.18
8.2.140.0000.00824.66
8.2.130.0120.00626.16
8.2.120.0040.00419.48
8.2.110.0090.00020.99
8.2.100.0080.00417.57
8.2.90.0030.00519.21
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0030.00517.93
8.2.50.0000.01318.07
8.2.40.0040.00418.14
8.2.30.0100.00018.04
8.2.20.0030.00517.66
8.2.10.0040.00417.67
8.2.00.0000.00717.74
8.1.280.0030.01025.92
8.1.270.0050.00324.66
8.1.260.0130.00326.35
8.1.250.0080.00028.09
8.1.240.0090.00021.37
8.1.230.0090.00317.58
8.1.220.0090.00017.91
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0000.00817.38
8.1.180.0080.00018.10
8.1.170.0080.00018.84
8.1.160.0040.00418.73
8.1.150.0040.00418.63
8.1.140.0040.00417.37
8.1.130.0070.00017.81
8.1.120.0000.00717.44
8.1.110.0000.00717.43
8.1.100.0030.00417.45
8.1.90.0080.00017.46
8.1.80.0000.00717.36
8.1.70.0030.00517.48
8.1.60.0040.00417.61
8.1.50.0030.00517.34
8.1.40.0040.00417.55
8.1.30.0040.00417.61
8.1.20.0060.00317.69
8.1.10.0030.00517.47
8.1.00.0030.00517.41
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0030.00318.44
8.0.270.0030.00317.26
8.0.260.0000.00716.68
8.0.250.0000.00816.85
8.0.240.0070.00016.95
8.0.230.0030.00316.83
8.0.220.0030.00316.95
8.0.210.0030.00316.91
8.0.200.0060.00016.91
8.0.190.0000.00716.97
8.0.180.0030.00316.88
8.0.170.0000.00816.89
8.0.160.0000.00716.86
8.0.150.0050.00316.95
8.0.140.0030.00616.70
8.0.130.0000.00613.33
8.0.120.0040.00416.88
8.0.110.0050.00216.73
8.0.100.0000.00716.87
8.0.90.0000.00716.79
8.0.80.0120.00916.92
8.0.70.0070.00016.86
8.0.60.0000.00816.73
8.0.50.0080.00016.78
8.0.30.0060.01516.98
8.0.20.0090.00917.17
8.0.10.0040.00416.95
8.0.00.0110.01216.70
7.4.330.0000.00613.00
7.4.320.0070.00416.61
7.4.300.0030.00316.47
7.4.290.0070.00016.59
7.4.280.0080.00016.49
7.4.270.0030.00516.52
7.4.260.0030.00313.21
7.4.250.0000.00816.59
7.4.240.0000.00716.57
7.4.230.0000.00716.61
7.4.220.0120.01216.40
7.4.210.0080.00716.52
7.4.200.0000.00716.70
7.4.190.0050.00216.45
7.4.160.0150.00316.58
7.4.150.0070.01016.52
7.4.140.0110.00616.33
7.4.130.0100.00616.53
7.4.120.0030.01416.49
7.4.110.0080.01116.43
7.4.100.0070.01016.60
7.4.90.0090.00916.51
7.4.80.0090.01519.39
7.4.70.0100.01016.60
7.4.60.0180.00316.50
7.4.50.0000.00416.53
7.4.40.0070.00316.43
7.4.30.0090.00616.55
7.4.00.0080.00615.00
7.3.330.0000.00613.07
7.3.320.0070.00013.07
7.3.310.0040.00416.32
7.3.300.0000.00716.23
7.3.290.0110.00816.29
7.3.280.0050.01316.27
7.3.270.0120.00916.41
7.3.260.0120.00616.69
7.3.250.0160.00516.40
7.3.240.0120.00616.27
7.3.230.0160.00616.41
7.3.210.0130.00616.34
7.3.200.0040.01416.44
7.3.190.0130.00916.56
7.3.180.0060.00916.41
7.3.170.0070.01816.46
7.3.160.0120.00416.45
7.3.120.0070.01114.84
7.2.330.0060.01816.77
7.2.320.0120.00616.46
7.2.310.0100.01016.76
7.2.300.0030.01316.45
7.2.290.0130.00316.95
7.2.00.0060.00619.29
7.1.100.0030.00918.29
7.1.70.0070.00317.22
7.1.60.0070.01719.40
7.1.50.0030.01716.74
7.1.00.0000.07722.43
7.0.200.0280.00314.61
7.0.140.0030.07322.08
7.0.120.0100.06022.19
7.0.60.0000.04319.96
7.0.50.0070.05017.86
7.0.40.0100.08020.08
7.0.30.0270.04020.30
7.0.20.0300.07720.06
7.0.10.0270.06720.11
7.0.00.0070.09320.09
5.6.280.0030.07020.90
5.6.210.0070.05720.54
5.6.200.0100.07318.16
5.6.190.0070.04720.55
5.6.180.0330.08020.35
5.6.170.0200.04020.52
5.6.160.0100.08720.41
5.6.150.0070.04318.22
5.6.140.0130.06718.23
5.6.130.0100.05018.11
5.6.120.0030.08320.96
5.6.110.0000.04721.01
5.6.100.0070.04721.12
5.6.90.0100.08321.02
5.6.80.0070.07020.35
5.6.70.4230.04020.49
5.5.350.0370.07020.30
5.5.340.0070.08318.01
5.5.330.0100.08020.28
5.5.320.0270.04720.25
5.5.310.0300.05320.31
5.5.300.0070.07017.89
5.5.290.0070.07317.96
5.5.280.0030.04320.79
5.5.270.0170.07320.73
5.5.260.0130.08320.86
5.5.250.0000.09020.77
5.5.240.0130.07020.25
5.4.450.0270.05719.43
5.4.440.0230.07019.40
5.4.430.0270.06719.45
5.4.420.0230.07019.41
5.4.410.0370.05718.98
5.4.400.0370.04319.14
5.4.390.0330.06719.09
5.4.380.0230.07018.81
5.4.370.0270.07018.81
5.4.360.0300.06718.75
5.4.350.0230.07019.10
5.4.340.0170.07019.15
5.4.320.0300.07019.22
5.4.310.0270.06719.09
5.4.300.0170.06019.21
5.4.290.0170.04718.79
5.4.280.0300.06718.80
5.4.270.0200.03719.21
5.4.260.0370.06719.06
5.4.250.0270.07319.05
5.4.240.0330.06318.91
5.4.230.0330.06318.78
5.4.220.0230.04719.09
5.4.210.0270.06019.04
5.4.200.0230.03718.80
5.4.190.0270.06719.08
5.4.180.0130.04319.12
5.4.170.0230.06019.23
5.4.160.0170.05018.76
5.4.150.0400.04019.11
5.4.140.0230.07016.16
5.4.130.0300.06716.37
5.4.120.0200.04316.16
5.4.110.0200.05716.20
5.4.100.0200.04716.41
5.4.90.0170.03716.48
5.4.80.0230.06016.42
5.4.70.0200.07016.45
5.4.60.0170.05316.24
5.4.50.0270.06716.17
5.4.40.0270.06716.36
5.4.30.0170.07016.17
5.4.20.0170.06316.39
5.4.10.0200.07716.45
5.4.00.0270.05715.80
5.3.290.0230.06714.49
5.3.280.0170.07714.55
5.3.270.0130.04314.55
5.3.260.0230.05314.45
5.3.250.0200.04714.59
5.3.240.0200.04714.45
5.3.230.0230.07714.44
5.3.220.0270.07314.52
5.3.210.0230.07714.41
5.3.200.0300.06714.51
5.3.190.0170.06314.59
5.3.180.0270.07014.39
5.3.170.0230.05714.51
5.3.160.0270.05714.39
5.3.150.0200.06014.54
5.3.140.0270.07014.53
5.3.130.0200.04314.45
5.3.120.0230.07714.52
5.3.110.0230.05014.53
5.3.100.0230.07013.94
5.3.90.0300.04714.00
5.3.80.0300.06713.86
5.3.70.0400.05013.97
5.3.60.0300.06313.94
5.3.50.0200.05313.90
5.3.40.0200.07313.89
5.3.30.0200.04313.77
5.3.20.0230.06313.64
5.3.10.0230.06713.64
5.3.00.0200.04713.43
5.2.170.0200.06312.04
5.2.160.0200.04712.04
5.2.150.0100.05312.04
5.2.140.0270.05712.04
5.2.130.0170.05012.04
5.2.120.0200.05712.04
5.2.110.0300.04712.04
5.2.100.0130.03012.04
5.2.90.0170.05312.04
5.2.80.0170.05712.04
5.2.70.0200.05712.04
5.2.60.0200.04012.04
5.2.50.0230.05712.04
5.2.40.0170.04012.04
5.2.30.0130.05012.04
5.2.20.0170.05312.04
5.2.10.0170.05312.04
5.2.00.0200.05712.04
5.1.60.0300.04712.04
5.1.50.0130.04712.04
5.1.40.0130.02712.04
5.1.30.0130.02712.04
5.1.20.0200.04012.04
5.1.10.0200.04712.04
5.1.00.0170.05312.04
5.0.50.0100.03712.04
5.0.40.0100.02712.04
5.0.30.0070.06312.04
5.0.20.0100.04312.04
5.0.10.0070.03012.04
5.0.00.0130.03312.04
4.4.90.0100.03312.04
4.4.80.0030.02312.04
4.4.70.0100.02312.04
4.4.60.0100.03712.04
4.4.50.0070.03012.04
4.4.40.0070.03012.04
4.4.30.0000.02312.04
4.4.20.0130.02012.04
4.4.10.0130.02012.04
4.4.00.0130.03012.04
4.3.110.0070.02012.04
4.3.100.0070.03712.04
4.3.90.0100.02312.04
4.3.80.0070.05312.04
4.3.70.0070.03012.04
4.3.60.0070.03312.04
4.3.50.0070.03012.04
4.3.40.0070.05312.04
4.3.30.0030.02712.04
4.3.20.0030.04012.04
4.3.10.0030.03312.04
4.3.00.0030.02012.04

preferences:
41.44 ms | 401 KiB | 5 Q