3v4l.org

run code in 300+ PHP versions simultaneously
<?php $routes = [ 'primary' => [ 'pattern' => '#/(?P<resource>[^/\\\\.,;?\n]+)/foobar#', 'default' => [ 'action' => 'standard', ], ], 'secundary' => [ 'pattern' => '#^/(?P<id>[0-9]+)$#', 'default' => [ 'resource' => 'catalog', 'action' => 'view', ] ], 'fallback' => [ 'pattern' => '#^(?:(?:/(?P<action>[^/\\\\.,;?\n]+))?/(?P<resource>[^/\\\\.,;?\n]+))?$#', 'default' => [ 'resource' => 'main', 'action' => 'landing', ], ], ]; $url = '/foobar/12345'; $current = null; foreach ($routes as $name => $route) { $matches = []; if ( preg_match( $route['pattern'], $url, $matches ) ) { $current = $name; break; } } var_dump( $name, $matches );

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.0090.00618.55
8.3.50.0070.01122.05
8.3.40.0150.00318.81
8.3.30.0040.01118.87
8.3.20.0040.00418.88
8.3.10.0090.00021.01
8.3.00.0060.00323.65
8.2.180.0180.00016.88
8.2.170.0000.01522.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00926.16
8.2.120.0080.00020.90
8.2.110.0000.00822.34
8.2.100.0090.00317.97
8.2.90.0040.00419.17
8.2.80.0000.00719.28
8.2.70.0070.00417.88
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0030.00518.14
8.2.30.0000.00719.52
8.2.20.0040.00417.98
8.2.10.0000.00817.86
8.2.00.0060.00617.97
8.1.280.0130.00625.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0120.00020.67
8.1.230.0110.00020.82
8.1.220.0000.00818.77
8.1.210.0050.00318.97
8.1.200.0100.00017.35
8.1.190.0050.00317.66
8.1.180.0040.00418.10
8.1.170.0000.00918.78
8.1.160.0040.00418.93
8.1.150.0030.00518.86
8.1.140.0000.00817.49
8.1.130.0040.00417.86
8.1.120.0050.00317.60
8.1.110.0040.00417.54
8.1.100.0080.00017.63
8.1.90.0070.00017.62
8.1.80.0050.00217.54
8.1.70.0030.00317.61
8.1.60.0030.00617.63
8.1.50.0050.00317.52
8.1.40.0030.00617.59
8.1.30.0000.00817.74
8.1.20.0040.00417.76
8.1.10.0020.00517.73
8.1.00.0000.00817.56
8.0.300.0060.00319.91
8.0.290.0040.00417.05
8.0.280.0040.00418.43
8.0.270.0040.00417.23
8.0.260.0000.00717.04
8.0.250.0080.00017.04
8.0.240.0000.00917.05
8.0.230.0070.00017.15
8.0.220.0050.00317.01
8.0.210.0030.00317.00
8.0.200.0070.00017.12
8.0.190.0030.00517.07
8.0.180.0000.00717.11
8.0.170.0040.00417.10
8.0.160.0040.00416.95
8.0.150.0000.00816.90
8.0.140.0080.00016.88
8.0.130.0000.00713.40
8.0.120.0050.00316.99
8.0.110.0080.00016.94
8.0.100.0070.00017.02
8.0.90.0030.00516.97
8.0.80.0130.00617.00
8.0.70.0040.00417.06
8.0.60.0040.00417.09
8.0.50.0020.00517.03
8.0.30.0150.00517.28
8.0.20.0110.01017.41
8.0.10.0080.00017.24
8.0.00.0170.00116.89
7.4.330.0000.00516.71
7.4.320.0030.00316.76
7.4.300.0000.00616.83
7.4.290.0030.00316.78
7.4.280.0000.00816.83
7.4.270.0020.00516.71
7.4.260.0030.00313.52
7.4.250.0060.00316.67
7.4.240.0040.00416.78
7.4.230.0000.00716.66
7.4.220.0160.01016.54
7.4.210.0110.00416.79
7.4.200.0040.00416.84
7.4.190.0030.00316.71
7.4.160.0110.00716.79
7.4.150.0110.01417.40
7.4.140.0050.01217.86
7.4.130.0090.00816.75
7.4.120.0110.00916.71
7.4.110.0060.01216.88
7.4.100.0080.01216.63
7.4.90.0240.00016.84
7.4.80.0110.00519.39
7.4.70.0070.01016.64
7.4.60.0100.01016.80
7.4.50.0030.00616.45
7.4.40.0070.01122.77
7.4.30.0080.01216.62
7.4.00.0090.00614.80
7.3.330.0000.00513.35
7.3.320.0060.00013.34
7.3.310.0000.00716.55
7.3.300.0060.00016.42
7.3.290.0090.00616.47
7.3.280.0120.00716.52
7.3.270.0120.00617.40
7.3.260.0080.01018.24
7.3.250.0100.00816.66
7.3.240.0160.00616.72
7.3.230.0030.01316.58
7.3.210.0030.01416.73
7.3.200.0060.01019.39
7.3.190.0100.01316.86
7.3.180.0160.00416.66
7.3.170.0060.01016.57
7.3.160.0160.00016.89
7.3.120.0070.00715.03
7.2.330.0110.00616.76
7.2.320.0060.01216.84
7.2.310.0110.00716.79
7.2.300.0070.01016.76
7.2.290.0090.00816.85
7.2.00.0030.01319.47
7.1.100.0000.01618.20
7.1.70.0060.00317.09
7.1.60.0150.01117.36
7.1.50.0120.00917.21
7.1.00.0030.03322.34
7.0.200.0060.00916.95
7.0.140.0000.07722.04
7.0.60.0230.08719.89
7.0.50.0030.08317.81
7.0.40.0130.08020.23
7.0.30.0270.06320.18
7.0.20.0300.07720.01
7.0.10.0030.08320.20
7.0.00.0030.09020.05
5.6.280.0030.07320.92
5.6.210.0070.08720.51
5.6.200.0030.08718.12
5.6.190.0030.06320.28
5.6.180.0230.03720.27
5.6.170.0300.07320.50
5.6.160.0100.04320.71
5.6.150.0070.05018.15
5.6.140.0030.05718.09
5.6.130.0200.06318.18
5.6.120.0070.07721.05
5.6.110.0130.07721.04
5.6.100.0100.05320.98
5.6.90.0200.07020.96
5.6.80.0000.04320.38
5.5.350.0230.07720.29
5.5.340.0000.04718.02
5.5.330.0070.04320.19
5.5.320.0300.07320.20
5.5.310.0270.06320.41
5.5.300.0070.08017.89
5.5.290.0100.05018.03
5.5.280.0030.08720.85
5.5.270.0100.07020.86
5.5.260.0230.06320.77
5.5.250.0130.07320.58
5.5.240.0100.03020.12
5.4.450.4230.04319.20
5.4.440.0030.05319.20
5.4.430.1230.05719.47
5.4.420.4530.03319.25
5.4.410.4070.03719.34
5.4.400.3630.03719.17
5.4.390.1970.04018.97
5.4.380.3200.03318.87
5.4.370.3630.03319.15
5.4.360.4700.04319.16
5.4.350.4430.03719.16
5.4.340.4270.03319.09
5.4.320.4270.04319.23
5.4.310.3730.02719.07
5.4.300.4670.03719.17
5.4.290.4170.03718.87
5.4.280.4070.04019.08
5.4.270.3770.03719.14
5.4.260.3770.04319.03
5.4.250.3730.04018.96
5.4.240.3930.03718.86
5.4.230.3870.03719.11
5.4.220.3770.03718.88
5.4.210.3970.03318.88
5.4.200.3870.04019.17
5.4.190.3430.03718.87
5.4.180.3900.03719.13
5.4.170.3530.03718.99
5.4.160.4330.04318.85
5.4.150.3800.03719.21
5.4.140.3770.03716.31
5.4.130.4770.04316.46
5.4.120.3570.03316.45
5.4.110.3300.03316.50
5.4.100.4130.03716.30
5.4.90.4030.03316.27
5.4.80.3630.03016.26
5.4.70.3770.03016.19
5.4.60.3830.04016.20
5.4.50.3970.04316.13
5.4.40.3700.03716.35
5.4.30.3970.04016.43
5.4.20.3800.03316.55
5.4.10.3730.04016.39
5.4.00.3930.02015.86
5.3.290.3800.03314.75
5.3.280.3530.04014.55
5.3.270.3770.03314.53
5.3.260.4600.04014.48
5.3.250.3530.03714.56
5.3.240.4130.04014.54
5.3.230.3770.04314.41
5.3.220.3570.03314.48
5.3.210.4070.04314.54
5.3.200.3870.03314.49
5.3.190.3830.03314.51
5.3.180.3670.04014.50
5.3.170.3830.03714.48
5.3.160.5400.03014.36
5.3.150.4270.03314.46
5.3.140.3800.04314.50
5.3.130.3970.03714.45
5.3.120.3700.03714.52
5.3.110.3700.03714.49
5.3.100.3570.03313.86
5.3.90.3500.03714.11
5.3.80.4070.04013.96
5.3.70.3600.03713.85
5.3.60.3570.03313.93
5.3.50.3530.04014.03
5.3.40.0030.07713.87
5.3.30.0070.03713.87
5.3.20.3600.04013.66
5.3.10.3930.03313.75
5.3.00.3770.03713.59
5.2.170.3430.03011.03
5.2.160.3400.03011.08
5.2.150.0100.06011.08
5.2.140.0670.06011.13
5.2.130.3130.03711.18
5.2.120.3270.02311.04
5.2.110.2800.02711.03
5.2.100.3630.02710.99
5.2.90.3400.02711.08
5.2.80.3800.03310.91
5.2.70.3630.02711.02
5.2.60.3730.03011.20
5.2.50.3900.02710.93
5.2.40.3100.03010.99
5.2.30.3300.03710.81
5.2.20.2830.03010.78
5.2.10.1770.03010.85
5.2.00.2300.03710.60
5.1.60.2030.0279.96
5.1.50.2430.0239.89
5.1.40.0200.0239.82
5.1.30.0130.02010.42
5.1.20.0000.02710.34
5.1.10.0000.03010.14
5.1.00.0000.0279.91
5.0.50.1200.0208.54
5.0.40.1370.0208.38
5.0.30.1170.0308.28
5.0.20.1000.0208.34
5.0.10.1000.0208.07
5.0.00.1200.0308.20
4.4.90.1800.0176.33
4.4.80.1730.0176.33
4.4.70.1330.0206.33
4.4.60.1430.0176.33
4.4.50.0930.0136.33
4.4.40.0970.0306.33
4.4.30.1270.0106.33
4.4.20.0000.0276.33
4.4.10.1200.0176.33
4.4.00.1200.0236.33
4.3.110.0970.0136.33
4.3.100.1030.0176.33
4.3.90.1400.0176.33
4.3.80.1030.0306.33
4.3.70.1030.0176.33
4.3.60.1400.0176.33
4.3.50.1270.0136.33
4.3.40.1270.0176.33
4.3.30.0600.0176.33
4.3.20.0400.0106.33
4.3.10.0630.0136.33
4.3.00.0470.0136.33

preferences:
40.83 ms | 401 KiB | 5 Q