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.0040.01116.50
8.3.50.0140.00416.54
8.3.40.0120.00318.95
8.3.30.0070.00718.84
8.3.20.0080.00020.16
8.3.10.0030.00521.82
8.3.00.0030.00523.70
8.2.180.0150.00016.50
8.2.170.0110.00722.96
8.2.160.0110.00320.39
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00919.77
8.2.120.0070.00026.35
8.2.110.0060.00322.31
8.2.100.0040.00717.93
8.2.90.0000.00819.09
8.2.80.0040.00417.97
8.2.70.0050.00517.88
8.2.60.0080.00018.05
8.2.50.0000.01218.07
8.2.40.0000.00822.31
8.2.30.0000.00819.55
8.2.20.0040.00417.95
8.2.10.0000.01018.21
8.2.00.0000.00818.22
8.1.280.0120.00325.92
8.1.270.0100.01023.69
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0060.00323.92
8.1.230.0120.00019.00
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0060.00317.48
8.1.180.0050.00318.10
8.1.170.0040.00418.61
8.1.160.0070.00020.71
8.1.150.0040.00418.99
8.1.140.0040.00419.61
8.1.130.0000.00717.75
8.1.120.0030.00517.66
8.1.110.0050.00217.53
8.1.100.0030.00517.61
8.1.90.0000.00717.52
8.1.80.0040.00417.63
8.1.70.0030.00317.52
8.1.60.0030.00617.63
8.1.50.0040.00517.70
8.1.40.0030.00517.59
8.1.30.0030.00617.86
8.1.20.0040.00417.78
8.1.10.0030.00617.74
8.1.00.0040.00417.74
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.36
8.0.270.0030.00617.20
8.0.260.0030.00317.16
8.0.250.0070.00017.02
8.0.240.0040.00417.16
8.0.230.0000.00717.00
8.0.220.0060.00317.05
8.0.210.0040.00417.07
8.0.200.0000.00916.98
8.0.190.0000.00717.11
8.0.180.0000.00717.03
8.0.170.0040.00417.11
8.0.160.0030.00617.06
8.0.150.0040.00416.85
8.0.140.0040.00416.98
8.0.130.0060.00013.54
8.0.120.0080.00016.85
8.0.110.0000.00717.03
8.0.100.0050.00216.88
8.0.90.0040.00417.05
8.0.80.0120.00917.04
8.0.70.0080.00017.04
8.0.60.0040.00416.88
8.0.50.0040.00416.93
8.0.30.0110.00917.34
8.0.20.0090.01117.49
8.0.10.0000.00717.16
8.0.00.0120.00816.87
7.4.330.0050.00016.87
7.4.320.0060.00016.59
7.4.300.0050.00216.66
7.4.290.0070.00016.82
7.4.280.0100.00016.72
7.4.270.0070.00016.82
7.4.260.0000.00716.83
7.4.250.0080.00016.84
7.4.240.0030.00316.75
7.4.230.0070.00016.92
7.4.220.0060.01716.81
7.4.210.0060.01516.85
7.4.200.0000.00716.95
7.4.160.0040.01516.59
7.4.150.0140.00717.40
7.4.140.0110.01417.86
7.4.130.0110.00716.82
7.4.120.0100.01116.79
7.4.110.0110.00716.81
7.4.100.0140.00416.87
7.4.90.0070.01116.60
7.4.80.0080.01619.39
7.4.70.0160.00916.62
7.4.60.0080.00816.54
7.4.50.0070.00716.64
7.4.40.0100.00516.72
7.4.30.0120.00916.50
7.4.00.0050.01215.29
7.3.330.0000.00513.52
7.3.320.0050.00213.56
7.3.310.0040.00416.36
7.3.300.0000.00716.54
7.3.290.0080.00816.54
7.3.280.0100.00416.53
7.3.270.0070.01017.40
7.3.260.0000.01916.51
7.3.250.0100.01016.73
7.3.240.0160.00616.64
7.3.230.0070.01116.81
7.3.210.0160.00616.53
7.3.200.0090.00616.75
7.3.190.0120.00416.45
7.3.180.0110.00716.75
7.3.170.0130.00316.47
7.3.160.0120.00416.50
7.3.120.0060.00915.18
7.3.110.0110.00515.13
7.3.100.0070.00714.67
7.3.90.0050.00715.09
7.3.80.0060.00914.80
7.3.70.0070.00715.04
7.3.60.0050.00914.80
7.3.50.0070.00615.02
7.3.40.0070.00914.84
7.3.30.0060.00715.03
7.3.20.0070.00716.88
7.3.10.0110.00716.71
7.3.00.0120.00316.71
7.2.330.0070.01017.01
7.2.320.0130.00316.79
7.2.310.0130.01016.80
7.2.300.0070.01616.89
7.2.290.0060.01516.80
7.2.250.0110.00815.39
7.2.240.0040.01315.19
7.2.230.0040.01115.39
7.2.220.0070.00715.18
7.2.210.0050.00915.15
7.2.200.0050.00915.09
7.2.190.0060.00915.27
7.2.180.0130.00415.31
7.2.170.0060.00815.35
7.2.160.0060.00915.34
7.2.150.0140.00717.05
7.2.140.0070.01516.96
7.2.130.0140.00617.12
7.2.120.0100.00716.69
7.2.110.0080.01117.09
7.2.100.0170.00016.95
7.2.90.0030.01117.00
7.2.80.0080.00817.27
7.2.70.0120.00316.86
7.2.60.0070.00917.18
7.2.50.0100.00316.81
7.2.40.0030.01317.08
7.2.30.0040.01216.81
7.2.20.0030.01017.27
7.2.10.0130.00316.98
7.2.00.0110.00418.31
7.1.330.0090.00716.03
7.1.320.0030.01115.94
7.1.310.0060.00616.14
7.1.300.0100.00415.93
7.1.290.0100.00515.88
7.1.280.0030.01216.02
7.1.270.0090.00515.92
7.1.260.0070.00916.00
7.1.250.0100.00715.59
7.1.200.0040.00816.03
7.1.100.0000.01618.54
7.1.70.0060.01017.14
7.1.60.0120.01219.30
7.1.50.0090.00917.27
7.1.00.0030.07722.47
7.0.200.0090.00616.96
7.0.60.0400.06720.06
7.0.50.0070.07317.94
7.0.40.0030.04720.26
7.0.30.0300.06720.35
7.0.20.0370.07320.26
7.0.10.0030.05320.28
7.0.00.0000.06320.14
5.6.280.0100.06721.07
5.6.210.0030.06720.47
5.6.200.0200.05718.25
5.6.190.0070.05020.63
5.6.180.0470.06720.64
5.6.170.0230.08320.47
5.6.160.0100.03720.51
5.6.150.0000.04318.23
5.6.140.0100.06718.15
5.6.130.0130.05018.17
5.6.120.0030.08721.04
5.6.110.0070.03721.01
5.6.100.0030.08320.99
5.6.90.0170.03720.93
5.6.80.0170.05720.39
5.5.350.0170.08320.32
5.5.340.0030.04717.95
5.5.330.0100.06320.29
5.5.320.0230.05020.36
5.5.310.0230.04720.30
5.5.300.0130.07018.08
5.5.290.0070.04318.00
5.5.280.0030.07020.77
5.5.270.0100.06720.82
5.5.260.0030.04320.79
5.5.250.0070.07020.56
5.5.240.0230.06720.16

preferences:
69.34 ms | 401 KiB | 5 Q