3v4l.org

run code in 300+ PHP versions simultaneously
<?php function extractRouteParameterComponents($routeParameter) { $regexPattern = "/^{(\w+)(?::(.+))?}(\?)?$/"; if (preg_match($regexPattern, $routeParameter, $matches)) { $name = $matches[1]; $type = $matches[2] ?? "[^/]"; $optional = isset($matches[3]); return [$name, $type, $optional]; } } $routeParameter = "{id:[0-9]+}?"; $parameterComponents = extractRouteParameterComponents($routeParameter); var_dump($parameterComponents);

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.01016.63
8.3.50.0130.00721.36
8.3.40.0070.01318.92
8.3.30.0110.00418.80
8.3.20.0090.00020.23
8.3.10.0040.00421.77
8.3.00.0070.00023.66
8.2.180.0090.01216.88
8.2.170.0140.00322.96
8.2.160.0110.00420.38
8.2.150.0000.00924.18
8.2.140.0080.00024.66
8.2.130.0080.00019.89
8.2.120.0000.00826.35
8.2.110.0100.00022.36
8.2.100.0030.00917.93
8.2.90.0040.00419.09
8.2.80.0040.00417.97
8.2.70.0060.00317.88
8.2.60.0040.00418.05
8.2.50.0090.00318.07
8.2.40.0000.00822.28
8.2.30.0000.00719.68
8.2.20.0040.00418.03
8.2.10.0060.00318.16
8.2.00.0030.00518.09
8.1.280.0030.01225.92
8.1.270.0130.00723.76
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0000.00823.79
8.1.230.0070.00419.00
8.1.220.0050.00317.79
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0030.00617.23
8.1.180.0030.00618.10
8.1.170.0040.00418.84
8.1.160.0020.00520.68
8.1.150.0040.00418.93
8.1.140.0040.00419.49
8.1.130.0000.00817.74
8.1.120.0040.00417.51
8.1.110.0040.00417.68
8.1.100.0000.00817.68
8.1.90.0040.00417.65
8.1.80.0040.00417.61
8.1.70.0070.00017.68
8.1.60.0000.00917.65
8.1.50.0030.00517.58
8.1.40.0000.00817.69
8.1.30.0090.00017.76
8.1.20.0000.00817.89
8.1.10.0040.00417.72
8.1.00.0030.00517.70
8.0.300.0000.00818.77
8.0.290.0070.00016.88
8.0.280.0070.00018.40
8.0.270.0000.00817.23
8.0.260.0000.00617.27
8.0.250.0000.00717.04
8.0.240.0040.00417.11
8.0.230.0030.00317.00
8.0.220.0030.00617.02
8.0.210.0070.00016.95
8.0.200.0060.00317.00
8.0.190.0020.00517.10
8.0.180.0000.00817.10
8.0.170.0000.00817.11
8.0.160.0060.00317.07
8.0.150.0040.00417.06
8.0.140.0050.00516.98
8.0.130.0090.00013.41
8.0.120.0000.00916.93
8.0.110.0070.00016.99
8.0.100.0040.00417.06
8.0.90.0000.00717.02
8.0.80.0070.01417.01
8.0.70.0040.00416.93
8.0.60.0040.00416.93
8.0.50.0050.00217.03
8.0.30.0080.00917.38
8.0.20.0150.00617.40
8.0.10.0000.00717.04
8.0.00.0090.01217.00
7.4.330.0020.00216.71
7.4.320.0030.00316.75
7.4.300.0000.00716.63
7.4.290.0000.00716.83
7.4.280.0080.00316.82
7.4.270.0000.00716.72
7.4.260.0040.00416.73
7.4.250.0060.00316.79
7.4.240.0050.00316.74
7.4.230.0000.00816.92
7.4.220.0100.01016.77
7.4.210.0110.00716.77
7.4.200.0070.00016.65
7.4.160.0080.00816.75
7.4.150.0030.01617.40
7.4.140.0090.01017.86
7.4.130.0140.00416.83
7.4.120.0110.00916.75
7.4.110.0200.00316.61
7.4.100.0120.00616.80
7.4.90.0090.00916.64
7.4.80.0060.01219.39
7.4.70.0040.01216.73
7.4.60.0090.00616.64
7.4.50.0030.01416.90
7.4.40.0140.00316.63
7.4.30.0110.01116.80
7.4.00.0060.00915.21
7.3.330.0000.00513.54
7.3.320.0000.00713.39
7.3.310.0070.00016.52
7.3.300.0050.00316.54
7.3.290.0090.01016.56
7.3.280.0060.00816.51
7.3.270.0120.00617.40
7.3.260.0140.00816.46
7.3.250.0170.00516.54
7.3.240.0100.00916.67
7.3.230.0060.01116.54
7.3.210.0130.01016.72
7.3.200.0110.00519.39
7.3.190.0140.00316.57
7.3.180.0030.01416.55
7.3.170.0030.01416.71
7.3.160.0130.00316.69
7.3.10.0150.00616.28
7.3.00.0190.00816.59
7.2.330.0090.00916.91
7.2.320.0060.01016.84
7.2.310.0170.00616.80
7.2.300.0090.01516.63
7.2.290.0000.01617.00
7.2.130.0120.00816.89
7.2.120.0070.01016.80
7.2.110.0170.00316.70
7.2.100.0110.01117.04
7.2.90.0100.01316.66
7.2.80.0140.00617.22
7.2.70.0120.00816.50
7.2.60.0120.00217.07
7.2.50.0130.00516.57
7.2.40.0110.00716.97
7.2.30.0120.00716.84
7.2.20.0140.00417.11
7.2.10.0120.00816.46
7.2.00.0060.01118.24
7.1.250.0110.00615.39
7.1.200.0000.01115.88
7.1.100.0030.00518.36
7.1.70.0030.01417.34
7.1.60.0150.00919.30
7.1.50.0070.01017.14
7.1.00.0000.07722.39
7.0.200.0000.00817.02
7.0.100.0100.07020.03
7.0.90.0300.04319.90
7.0.80.0000.05720.01
7.0.70.0030.06720.05
7.0.60.0400.04320.08
7.0.50.0070.04020.18
7.0.40.0030.05020.07
7.0.30.0070.04320.07
7.0.20.0030.04320.08
7.0.10.0030.04320.14
7.0.00.0070.03319.98
5.6.280.0000.06021.11
5.6.250.0030.07720.57
5.6.240.0230.07320.76
5.6.230.0030.08320.69
5.6.220.0100.07720.63
5.6.210.0100.03720.62
5.6.200.0070.05020.96
5.6.190.0030.04321.05
5.6.180.0170.03320.96
5.6.170.0070.04021.03
5.6.160.0000.05021.03
5.6.150.0030.04021.02
5.6.140.0070.03721.02
5.6.130.0070.04321.03
5.6.120.0070.04021.04
5.6.110.0070.03321.16
5.6.100.0030.04021.02
5.6.90.0030.04321.08
5.6.80.0070.05020.56
5.6.70.0100.02720.39
5.6.60.0000.04320.45
5.6.50.0030.04320.43
5.6.40.0030.03320.32
5.6.30.0070.03720.47
5.6.20.0030.04020.43
5.6.10.0170.02720.38
5.6.00.0030.04020.41
5.5.380.0000.08720.50
5.5.370.0070.05720.36
5.5.360.0170.03320.36
5.5.350.0100.07720.47
5.5.340.0100.04020.83
5.5.330.0100.03720.73
5.5.320.0000.04320.61
5.5.310.0070.04020.87
5.5.300.0100.04020.64
5.5.290.0100.04020.73
5.5.280.0030.04020.75
5.5.270.0070.04320.82
5.5.260.0030.04320.77
5.5.250.0000.03720.72
5.5.240.0030.04020.12
5.5.230.0030.04020.11
5.5.220.0000.04020.16
5.5.210.0000.08020.31
5.5.200.0000.04019.96
5.5.190.0130.03020.27
5.5.180.0100.03320.11
5.5.160.0100.03320.27
5.5.150.0100.04020.24
5.5.140.0000.04320.26
5.5.130.0000.04320.24
5.5.120.0000.04720.15
5.5.110.0070.03720.26
5.5.100.0030.03719.95
5.5.90.0070.03720.17
5.5.80.0030.04020.06
5.5.70.0030.04020.09
5.5.60.0000.03320.05
5.5.50.0030.03020.08
5.5.40.0030.03020.06
5.5.30.0030.03720.05
5.5.20.0070.03019.93
5.5.10.0070.03320.06
5.5.00.0030.04019.97

preferences:
51.19 ms | 401 KiB | 5 Q