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); //Случай, когда * находится в конце строки - возможны любые вложенные пути if ($patternParts[count($patternParts)] = '') { array_pop($patternParts); var_dump($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.0070.01116.63
8.3.50.0090.01017.35
8.3.40.0110.00318.88
8.3.30.0130.00318.79
8.3.20.0040.00418.61
8.3.10.0050.00318.91
8.3.00.0030.00619.38
8.2.180.0120.00316.63
8.2.170.0150.00022.96
8.2.160.0060.00919.14
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0050.00519.79
8.2.110.0090.00020.35
8.2.100.0070.00717.59
8.2.90.0000.00819.34
8.2.80.0000.00917.97
8.2.70.0050.00317.50
8.2.60.0080.00017.93
8.2.50.0040.00418.07
8.2.40.0000.00919.15
8.2.30.0050.00517.80
8.2.20.0060.00317.65
8.2.10.0040.00417.79
8.2.00.0080.00017.81
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0090.00023.88
8.1.230.0070.00417.77
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0000.01017.48
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0060.00318.65
8.1.160.0000.00819.01
8.1.150.0030.00618.60
8.1.140.0000.00717.37
8.1.130.0000.00719.23
8.1.120.0050.00517.45
8.1.110.0000.00717.38
8.1.100.0070.00017.45
8.1.90.0030.00517.46
8.1.80.0070.00017.42
8.1.70.0000.00717.44
8.1.60.0000.00817.58
8.1.50.0000.00717.48
8.1.40.0060.00317.46
8.1.30.0030.00617.57
8.1.20.0060.00317.47
8.1.10.0040.00417.61
8.1.00.0050.00317.48
8.0.300.0040.00418.77
8.0.290.0030.00616.58
8.0.280.0030.00318.61
8.0.270.0070.00017.30
8.0.260.0000.00716.78
8.0.250.0030.00516.89
8.0.240.0040.00416.98
8.0.230.0050.00316.82
8.0.220.0000.01016.77
8.0.210.0000.00716.83
8.0.200.0030.00316.83
8.0.190.0020.00516.92
8.0.180.0040.00416.75
8.0.170.0080.00016.82
8.0.160.0060.00316.81
8.0.150.0030.00616.71
8.0.140.0000.00916.89
8.0.130.0050.00013.35
8.0.120.0030.00516.71
8.0.110.0050.00216.86
8.0.100.0050.00316.93
8.0.90.0040.00416.79
8.0.80.0080.00816.82
8.0.70.0050.00216.76
8.0.60.0070.00016.75
8.0.50.0040.00416.77
8.0.30.0160.00617.05
8.0.20.0110.00816.94
8.0.10.0080.00016.93
8.0.00.0050.01316.72
7.4.330.0040.00012.91
7.4.320.0000.00716.50
7.4.300.0000.00716.51
7.4.290.0030.00316.49
7.4.280.0050.00216.52
7.4.270.0070.00016.49
7.4.260.0050.00013.27
7.4.250.0040.00416.50
7.4.240.0050.00216.57
7.4.230.0100.00016.65
7.4.220.0130.00416.45
7.4.210.0100.01016.62
7.4.200.0040.00416.57
7.4.190.0000.00716.31
7.4.160.0090.00616.69
7.4.150.0120.00616.59
7.4.140.0000.02117.86
7.4.130.0000.01716.43
7.4.120.0090.00916.57
7.4.110.0100.01016.64
7.4.100.0120.00616.33
7.4.90.0120.00616.45
7.4.80.0110.00619.39
7.4.70.0030.01416.40
7.4.60.0090.01116.51
7.4.50.0000.00916.32
7.4.40.0070.01016.46
7.4.30.0110.00616.61
7.4.00.0100.00714.93
7.3.330.0040.00413.25
7.3.320.0030.00313.13
7.3.310.0050.00216.28
7.3.300.0040.00416.10
7.3.290.0070.00816.32
7.3.280.0130.00616.21
7.3.270.0100.00616.26
7.3.260.0090.00916.51
7.3.240.0130.00916.57
7.3.230.0120.00916.32
7.3.210.0060.01016.30
7.3.200.0060.01016.55
7.3.190.0100.01016.50
7.3.180.0060.01116.60
7.3.170.0060.01216.43
7.3.160.0000.01616.41
7.3.120.0060.01214.94
7.3.110.0000.01915.03
7.3.100.0040.01414.50
7.3.90.0070.01015.02
7.3.80.0090.00614.48
7.3.70.0000.01214.63
7.3.60.0070.00714.71
7.3.50.0030.01014.55
7.3.40.0000.00814.55
7.3.30.0040.00814.60
7.3.20.0090.00616.79
7.3.10.0060.00316.91
7.3.00.0080.00416.65
7.2.330.0120.00616.70
7.2.320.0030.01316.50
7.2.310.0180.00616.59
7.2.300.0100.00716.42
7.2.290.0090.00916.46
7.2.250.0000.02015.15
7.2.240.0030.01515.22
7.2.230.0150.00015.21
7.2.220.0000.01315.03
7.2.210.0120.00315.33
7.2.200.0030.01214.97
7.2.190.0030.01015.02
7.2.180.0110.00015.12
7.2.170.0030.01215.18
7.2.60.0070.00717.05
7.1.330.0080.00816.09
7.1.320.0030.01015.83
7.1.310.0000.01715.95
7.1.300.0000.01215.86
7.1.290.0060.00915.79
7.1.280.0060.00315.75
7.1.270.0090.00615.82
7.1.260.0120.00415.84
7.1.200.0000.01215.86
7.1.100.0030.01018.14
7.1.70.0050.00317.18
7.1.60.0030.01619.21
7.1.50.0100.01317.01
7.1.00.0000.03722.43
7.0.200.0120.00316.79
7.0.140.0070.07022.11
7.0.120.0030.07322.04
7.0.60.0100.08319.86
7.0.50.0170.06017.79
7.0.40.0130.03320.24
7.0.30.0270.08020.33
7.0.20.0200.06720.15
7.0.10.0070.04720.20
7.0.00.0070.06020.19
5.6.280.0030.07320.91
5.6.210.0070.08020.48
5.6.200.0130.07018.20
5.6.190.0000.04720.57
5.6.180.3770.04720.61
5.6.170.0200.05320.50
5.6.160.0100.08020.61
5.6.150.0030.03718.13
5.6.140.0030.08018.21
5.6.130.0070.08018.16
5.6.120.0130.06721.02
5.6.110.0100.07721.02
5.6.100.0070.08721.12
5.6.90.0130.08020.97
5.6.80.0100.07320.41
5.6.70.4400.03720.52
5.5.350.0070.07320.32
5.5.340.0070.08018.02
5.5.330.0070.07720.25
5.5.320.0330.07320.27
5.5.310.0170.06020.23
5.5.300.0000.08017.98
5.5.290.0070.08018.02
5.5.280.0200.07020.80
5.5.270.0070.04320.64
5.5.260.0170.07320.76
5.5.250.0030.04020.61
5.5.240.0200.03720.36
5.4.450.0070.07719.41
5.4.440.0000.08319.48
5.4.430.0070.05019.32
5.4.420.0100.05319.48
5.4.410.0070.05019.16
5.4.400.0130.06318.93
5.4.390.0070.07719.14
5.4.380.0170.06318.91
5.4.370.0130.05719.17
5.4.360.0100.07319.14
5.4.350.0070.07319.14
5.4.340.0000.05019.00
5.4.320.0070.04319.14
5.4.310.0130.06719.18
5.4.300.0100.07719.17
5.4.290.0070.07719.11
5.4.280.0030.06019.08
5.4.270.0200.03019.07
5.4.260.0070.07319.14
5.4.250.0100.04318.92
5.4.240.0030.04719.08
5.4.230.0000.04319.17
5.4.220.0030.05318.80
5.4.210.0200.06318.91
5.4.200.0030.08018.91
5.4.190.0030.03718.90
5.4.180.0070.04019.07
5.4.170.0030.03719.07
5.4.160.0030.03718.90
5.4.150.0000.04019.13
5.4.140.0030.03716.21
5.4.130.0000.03716.27
5.4.120.0030.04016.34
5.4.110.0100.03016.32
5.4.100.0070.03316.42
5.4.90.0070.03716.39
5.4.80.0030.03316.35
5.4.70.0000.03716.35
5.4.60.0000.03716.30
5.4.50.0000.03716.21
5.4.40.0030.03316.25
5.4.30.0000.03716.25
5.4.20.0000.03716.12
5.4.10.0100.02716.58
5.4.00.0030.03715.64
5.3.290.0070.06714.75
5.3.280.0130.05014.52
5.3.270.0030.03714.71
5.3.260.0100.03014.55
5.3.250.0070.03014.54
5.3.240.0070.03314.58
5.3.230.0030.04314.49
5.3.220.0030.03714.49
5.3.210.0030.03714.50
5.3.200.0030.03714.52
5.3.190.0070.03314.44
5.3.180.0000.04014.48
5.3.170.0000.04014.54
5.3.160.0030.03714.38
5.3.150.0030.03314.54
5.3.140.0070.04314.52
5.3.130.0070.04014.56
5.3.120.0030.03714.47
5.3.110.0070.04014.64
5.3.100.0070.03313.96
5.3.90.0030.03313.96
5.3.80.0000.04714.11
5.3.70.0030.08014.11
5.3.60.0000.03713.84
5.3.50.0030.04013.91
5.3.40.0030.03313.76
5.3.30.0030.03313.73
5.3.20.0000.03713.62
5.3.10.0030.03313.67
5.3.00.0030.03313.57
5.2.170.0000.03011.14
5.2.160.0000.03311.03
5.2.150.0000.03011.13
5.2.140.0000.03011.08
5.2.130.0030.03311.18
5.2.120.0030.02711.05
5.2.110.0000.03010.96
5.2.100.0030.02711.00
5.2.90.0030.02711.09
5.2.80.0100.03011.08
5.2.70.0000.04711.25
5.2.60.0000.03711.05
5.2.50.0030.05310.99
5.2.40.0000.03010.89
5.2.30.0000.03010.86
5.2.20.0100.05310.80
5.2.10.0030.03310.90
5.2.00.0070.05310.66
5.1.60.0100.03010.01
5.1.50.0070.0339.97
5.1.40.0030.0279.97
5.1.30.0030.05010.28
5.1.20.0000.03710.36
5.1.10.0070.05010.07
5.1.00.0070.05310.21
5.0.50.0100.0438.51
5.0.40.0030.0278.50
5.0.30.0030.0508.28
5.0.20.0000.0238.27
5.0.10.0070.0338.14
5.0.00.0070.0638.07
4.4.90.0030.0277.77
4.4.80.0030.0207.77
4.4.70.0000.0207.77
4.4.60.0000.0307.77
4.4.50.0030.0337.77
4.4.40.0070.0407.77
4.4.30.0030.0177.77
4.4.20.0070.0307.77
4.4.10.0070.0337.77
4.4.00.0030.0507.77
4.3.110.0030.0337.77
4.3.100.0030.0307.77
4.3.90.0030.0307.77
4.3.80.0000.0437.77
4.3.70.0030.0237.77
4.3.60.0000.0237.77
4.3.50.0070.0107.77
4.3.40.0030.0307.77
4.3.30.0030.0377.77
4.3.20.0000.0337.77
4.3.10.0030.0337.77
4.3.00.0000.0177.77

preferences:
49.87 ms | 401 KiB | 5 Q