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' => '#^.*$#', '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; $matches = $matches + $route['default']; break; } } var_dump( $current, $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.40.0110.00718.95
8.3.30.0110.00418.96
8.3.20.0000.00818.88
8.3.10.0080.00021.00
8.3.00.0060.00321.77
8.2.170.0040.01122.96
8.2.160.0100.01020.27
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.01026.16
8.2.120.0080.00021.04
8.2.110.0000.01021.13
8.2.100.0040.00818.16
8.2.90.0080.00019.18
8.2.80.0050.00317.97
8.2.70.0090.00018.00
8.2.60.0060.00318.04
8.2.50.0080.00018.10
8.2.40.0000.00820.50
8.2.30.0000.00719.52
8.2.20.0000.00718.00
8.2.10.0000.00817.97
8.2.00.0000.01117.84
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00322.62
8.1.230.0080.00320.32
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00617.50
8.1.190.0030.00617.35
8.1.180.0090.00018.10
8.1.170.0030.00518.78
8.1.160.0000.00722.19
8.1.150.0080.00018.84
8.1.140.0040.00417.61
8.1.130.0030.00317.88
8.1.120.0040.00417.55
8.1.110.0040.00417.67
8.1.100.0040.00417.67
8.1.90.0050.00317.60
8.1.80.0070.00017.64
8.1.70.0000.00717.57
8.1.60.0080.00017.77
8.1.50.0060.00317.55
8.1.40.0050.00317.68
8.1.30.0000.00817.70
8.1.20.0040.00417.84
8.1.10.0000.00817.68
8.1.00.0000.00817.63
8.0.300.0000.00718.77
8.0.290.0050.00216.88
8.0.280.0020.00518.48
8.0.270.0070.00417.29
8.0.260.0030.00317.04
8.0.250.0000.00717.20
8.0.240.0060.00317.17
8.0.230.0000.00717.04
8.0.220.0000.00717.12
8.0.210.0030.00317.13
8.0.200.0070.00017.18
8.0.190.0040.00417.22
8.0.180.0000.00717.15
8.0.170.0060.00317.18
8.0.160.0000.00817.12
8.0.150.0050.00317.13
8.0.140.0000.00717.08
8.0.130.0000.00513.52
8.0.120.0040.00417.11
8.0.110.0070.00017.18
8.0.100.0000.00716.97
8.0.90.0070.00016.98
8.0.80.0060.01017.16
8.0.70.0000.00717.09
8.0.60.0000.00817.18
8.0.50.0040.00417.05
8.0.30.0070.01317.21
8.0.20.0100.01317.40
8.0.10.0000.00817.30
8.0.00.0120.00716.99
7.4.330.0060.00016.72
7.4.320.0000.00616.71
7.4.300.0030.00316.79
7.4.290.0000.00716.66
7.4.280.0000.00716.82
7.4.270.0000.00716.70
7.4.260.0060.00013.47
7.4.250.0080.00016.74
7.4.240.0050.00316.81
7.4.230.0000.00716.59
7.4.220.0130.01316.66
7.4.210.0070.00916.73
7.4.200.0000.00716.92
7.4.190.0070.00016.59
7.4.160.0080.00816.58
7.4.150.0130.00617.40
7.4.140.0060.01217.86
7.4.130.0070.01016.54
7.4.120.0090.01016.82
7.4.110.0080.00816.79
7.4.100.0090.00916.76
7.4.90.0090.01516.88
7.4.80.0070.01019.39
7.4.70.0070.01616.50
7.4.60.0110.01416.84
7.4.50.0090.00016.81
7.4.40.0070.01022.77
7.4.30.0110.00716.64
7.4.00.0090.00915.36
7.3.330.0030.00313.15
7.3.320.0030.00313.39
7.3.310.0000.00716.58
7.3.300.0030.00316.39
7.3.290.0090.00616.44
7.3.280.0090.01316.56
7.3.270.0060.01317.40
7.3.260.0120.01218.24
7.3.250.0080.01216.45
7.3.240.0160.00616.70
7.3.230.0100.00716.75
7.3.210.0110.00516.46
7.3.200.0060.01219.39
7.3.190.0120.00616.41
7.3.180.0060.00916.59
7.3.170.0120.00816.42
7.3.160.0140.00616.42
7.3.120.0120.00315.27
7.2.330.0210.00316.75
7.2.320.0110.00716.79
7.2.310.0140.00816.86
7.2.300.0090.00916.89
7.2.290.0100.00716.68
7.2.00.0070.00419.60
7.1.100.0070.00718.34
7.1.70.0050.00517.42
7.1.60.0060.00617.59
7.1.50.0030.00717.14
7.1.00.0000.03722.43
7.0.200.0050.00516.75
7.0.140.0130.06722.08
7.0.100.0130.08319.95
7.0.90.0100.06019.89
7.0.80.0230.04719.86
7.0.70.0100.08319.88
7.0.60.0170.09019.90
7.0.50.0200.05720.39
7.0.40.0100.08319.95
7.0.30.0130.08020.05
7.0.20.0100.08020.05
7.0.10.0200.06020.14
7.0.00.0200.07320.12
5.6.250.0170.07020.57
5.6.240.0030.04320.55
5.6.230.0230.06720.45
5.6.220.0130.07320.68
5.6.210.0200.06720.41
5.6.200.0000.09021.02
5.6.190.0070.08320.95
5.6.180.0100.06320.98
5.6.170.0130.06321.10
5.6.160.0070.08721.07
5.6.150.0100.08021.00
5.6.140.0000.09321.11
5.6.130.0070.08021.02
5.6.120.0170.06321.07
5.6.110.0170.07321.02
5.6.100.0130.06021.01
5.6.90.0000.06721.08
5.6.80.0030.08020.41
5.6.70.0100.08320.31
5.6.60.0030.08720.30
5.6.50.0000.05720.48
5.6.40.0070.08320.44
5.6.30.0100.07320.49
5.6.20.0000.09020.41
5.6.10.0100.07020.29
5.6.00.0030.06020.36
5.5.380.0070.07720.25
5.5.370.0170.06020.36
5.5.360.0030.06320.29
5.5.350.0030.05720.41
5.5.340.0170.06320.77
5.5.330.0130.08020.83
5.5.320.0100.07720.76
5.5.310.0130.06720.89
5.5.300.0130.07020.64
5.5.290.0100.08320.86
5.5.280.0070.08320.86
5.5.270.0070.08020.79
5.5.260.0070.06020.87
5.5.250.0100.08020.58
5.5.240.0030.08020.29
5.5.230.0130.04720.17
5.5.220.0070.07720.23
5.5.210.0130.04020.29
5.5.200.0030.08320.13
5.5.190.0030.08720.13
5.5.180.0030.05320.27
5.5.160.0070.08720.13
5.5.150.0070.04719.99
5.5.140.0030.07720.24
5.5.130.0100.08020.12
5.5.120.0030.05320.22
5.5.110.0130.06720.26
5.5.100.0170.07020.16
5.5.90.0130.06319.94
5.5.80.0100.07320.07
5.5.70.0130.04720.09
5.5.60.0000.07320.00
5.5.50.0100.07720.08
5.5.40.0130.07319.93
5.5.30.0030.07720.14
5.5.20.0100.06720.08
5.5.10.0030.08020.02
5.5.00.0000.08319.95
5.4.450.0030.08719.45
5.4.440.0130.07019.36
5.4.430.0000.08319.35
5.4.420.0130.07719.38
5.4.410.0130.07718.98
5.4.400.0030.07019.06
5.4.390.0200.06018.90
5.4.380.0070.07719.06
5.4.370.0100.07019.13
5.4.360.0030.04018.95
5.4.350.0000.08318.90
5.4.340.0200.06719.10
5.4.320.0070.08018.78
5.4.310.0070.07319.05
5.4.300.0130.06718.97
5.4.290.0100.07019.14
5.4.280.0170.07018.94
5.4.270.0130.07319.11
5.4.260.0030.08019.11
5.4.250.0070.07718.77
5.4.240.0030.07718.92
5.4.230.0070.07718.89
5.4.220.0030.08019.01
5.4.210.0070.07719.06
5.4.200.0100.07318.80
5.4.190.0070.08018.93
5.4.180.0100.05319.03
5.4.170.0070.08019.05
5.4.160.0100.07319.05
5.4.150.0030.07719.04
5.4.140.0030.05316.36
5.4.130.0000.04016.26
5.4.120.0130.06716.27
5.4.110.0030.07716.26
5.4.100.0070.07316.51
5.4.90.0130.06716.31
5.4.80.0100.07016.45
5.4.70.0030.07716.47
5.4.60.0030.08016.34
5.4.50.0170.06316.28
5.4.40.0070.07316.41
5.4.30.0070.06716.37
5.4.20.0030.07316.28
5.4.10.0070.06016.33
5.4.00.0070.07015.66
5.3.290.0070.05314.60
5.3.280.0100.07714.46
5.3.270.0070.04314.61
5.3.260.0130.07314.46
5.3.250.0030.05014.54
5.3.240.0070.07714.57
5.3.230.0100.04014.46
5.3.220.0100.06314.40
5.3.210.0030.08014.53
5.3.200.0000.06314.54
5.3.190.0100.03714.55
5.3.180.0070.07714.56
5.3.170.0070.08014.55
5.3.160.0030.08014.56
5.3.150.0000.04714.56
5.3.140.0000.06014.56
5.3.130.0000.08714.46
5.3.120.0100.07014.54
5.3.110.0100.07014.41
5.3.100.0030.07714.05
5.3.90.0170.06014.02
5.3.80.0070.07714.02
5.3.70.0130.06013.97
5.3.60.0030.07713.96
5.3.50.0100.05713.93
5.3.40.0000.04313.91
5.3.30.0070.06713.85
5.3.20.0000.04013.67
5.3.10.0100.06713.52
5.3.00.0100.07013.63
5.2.170.0030.06711.09
5.2.160.0070.05711.13
5.2.150.0070.06011.00
5.2.140.0070.06010.93
5.2.130.0100.05310.91
5.2.120.0070.05710.89
5.2.110.0030.05311.09
5.2.100.0030.05710.91
5.2.90.0170.05311.02
5.2.80.0100.05710.93
5.2.70.0030.06310.95
5.2.60.0100.06011.08
5.2.50.0030.06011.09
5.2.40.0100.04710.95
5.2.30.0030.06310.83
5.2.20.0030.06010.95
5.2.10.0100.05010.90
5.2.00.0070.05310.66
5.1.60.0000.0539.84
5.1.50.0100.05010.01
5.1.40.0100.05010.02
5.1.30.0100.05310.36
5.1.20.0100.04310.41
5.1.10.0030.05310.09
5.1.00.0030.05010.11
5.0.50.0070.0479.50
5.0.40.0030.0409.50
5.0.30.0100.0579.50
5.0.20.0000.0309.50
5.0.10.0070.0409.50
5.0.00.0030.0639.50
4.4.90.0000.0339.50
4.4.80.0070.0279.50
4.4.70.0070.0339.50
4.4.60.0070.0309.50
4.4.50.0000.0339.50
4.4.40.0000.0579.50
4.4.30.0000.0379.50
4.4.20.0070.0309.50
4.4.10.0030.0379.50
4.4.00.0070.0509.50
4.3.110.0000.0379.50
4.3.100.0030.0279.50
4.3.90.0030.0339.50
4.3.80.0000.0579.50
4.3.70.0030.0239.50
4.3.60.0030.0379.50
4.3.50.0000.0409.50
4.3.40.0030.0539.50
4.3.30.0000.0379.50
4.3.20.0030.0309.50
4.3.10.0030.0209.50
4.3.00.0030.0309.50

preferences:
46.56 ms | 400 KiB | 5 Q