3v4l.org

run code in 300+ PHP versions simultaneously
<?php // CHANGE THIS $url = '/12345/product/GET'; $routes = [ 'primary' => [ 'pattern' => '#/(?P<resource>[^/\\\\.,;?\n]+)/foobar#', 'default' => [ 'action' => 'standard', ], ], 'secundary' => [ 'pattern' => '#^/(?P<id>[0-9]+)(?:/(?P<resource>[^/\\\\.,;?\n]+)(?:/(?P<action>[^/\\\\.,;?\n]+))?)?$#', 'default' => [ 'resource' => 'catalog', 'action' => 'view', ] ], 'fallback' => [ 'pattern' => '#^.*$#', 'default' => [ 'resource' => 'main', 'action' => 'landing', ], ], ]; $current = null; // matching the route foreach ($routes as $name => $route) { $matches = []; if ( preg_match( $route['pattern'], $url, $matches ) ) { $current = $name; $matches = $matches + $route['default']; break; } } // cleaning up results foreach ( array_keys($matches) as $key ) { if ( is_numeric($key) ) { unset( $matches[$key] ); } } // view results 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.60.0090.00618.56
8.3.50.0140.00316.48
8.3.40.0120.00318.84
8.3.30.0070.00720.29
8.3.20.0040.00419.04
8.3.10.0080.00020.96
8.3.00.0000.00722.50
8.2.180.0150.00016.88
8.2.170.0070.00722.96
8.2.160.0030.01020.35
8.2.150.0040.00424.18
8.2.140.0100.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00420.93
8.2.110.0040.00719.35
8.2.100.0120.00317.97
8.2.90.0000.00819.35
8.2.80.0060.00317.99
8.2.70.0000.00817.75
8.2.60.0040.00418.04
8.2.50.0030.00618.10
8.2.40.0050.00318.15
8.2.30.0040.00419.53
8.2.20.0040.00417.84
8.2.10.0030.00517.88
8.2.00.0000.00717.95
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.81
8.1.230.0030.00917.83
8.1.220.0040.00417.74
8.1.210.0000.01118.77
8.1.200.0090.00017.50
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0040.00418.69
8.1.160.0000.00718.93
8.1.150.0050.00318.80
8.1.140.0080.00317.61
8.1.130.0000.00717.93
8.1.120.0000.00717.61
8.1.110.0000.00717.67
8.1.100.0070.00017.63
8.1.90.0070.00017.66
8.1.80.0040.00417.65
8.1.70.0040.00417.53
8.1.60.0030.00617.76
8.1.50.0000.00817.72
8.1.40.0050.00317.67
8.1.30.0050.00317.73
8.1.20.0040.00417.76
8.1.10.0040.00417.70
8.1.00.0000.00817.67
8.0.300.0040.00418.77
8.0.290.0080.00316.88
8.0.280.0000.00718.41
8.0.270.0000.00717.29
8.0.260.0030.00317.02
8.0.250.0030.00317.02
8.0.240.0040.00417.14
8.0.230.0040.00417.11
8.0.220.0000.00817.00
8.0.210.0050.00317.13
8.0.200.0040.00717.10
8.0.190.0050.00317.21
8.0.180.0030.00517.07
8.0.170.0040.00417.08
8.0.160.0040.00417.14
8.0.150.0050.00317.07
8.0.140.0000.00717.15
8.0.130.0000.00513.50
8.0.120.0000.00816.98
8.0.110.0000.00716.94
8.0.100.0080.00017.15
8.0.90.0040.00417.13
8.0.80.0090.00617.11
8.0.70.0000.00717.18
8.0.60.0040.00417.11
8.0.50.0000.00717.15
8.0.30.0130.01117.21
8.0.20.0090.01117.45
8.0.10.0080.00017.17
8.0.00.0140.00517.11
7.4.330.0000.00516.72
7.4.320.0070.00016.67
7.4.300.0040.00416.80
7.4.290.0040.00416.76
7.4.280.0000.00716.71
7.4.270.0000.00716.72
7.4.260.0070.00313.46
7.4.250.0000.00716.68
7.4.240.0040.00416.77
7.4.230.0000.00716.89
7.4.220.0160.00916.69
7.4.210.0080.01016.74
7.4.200.0000.00716.86
7.4.190.0070.00016.91
7.4.160.0080.00816.73
7.4.150.0140.00417.40
7.4.140.0100.01217.86
7.4.130.0100.00916.88
7.4.120.0090.00916.74
7.4.110.0030.01616.75
7.4.100.0140.00416.76
7.4.90.0100.01616.85
7.4.80.0110.01419.39
7.4.70.0070.01016.63
7.4.60.0130.01216.68
7.4.50.0050.00316.61
7.4.40.0060.00622.77
7.4.30.0060.01616.62
7.4.00.0040.01115.15
7.3.330.0000.00513.27
7.3.320.0060.00013.32
7.3.310.0040.00416.59
7.3.300.0000.00616.48
7.3.290.0070.00716.57
7.3.280.0120.00516.50
7.3.270.0070.01117.40
7.3.260.0110.00818.24
7.3.250.0070.01116.59
7.3.240.0050.01416.75
7.3.230.0090.00916.65
7.3.210.0100.00716.67
7.3.200.0070.01619.39
7.3.190.0070.01016.84
7.3.180.0090.01216.71
7.3.170.0100.00716.48
7.3.160.0140.00916.51
7.3.120.0060.00915.27
7.3.10.0060.00616.45
7.3.00.0170.00316.41
7.2.330.0130.00816.81
7.2.320.0030.01317.02
7.2.310.0090.01516.64
7.2.300.0030.01316.82
7.2.290.0150.00316.71
7.2.130.0040.01516.62
7.2.120.0000.01816.80
7.2.110.0160.00616.79
7.2.100.0090.01016.57
7.2.90.0080.00416.75
7.2.80.0060.01616.63
7.2.70.0060.01016.75
7.2.60.0050.00916.97
7.2.50.0140.00316.71
7.2.40.0100.00716.95
7.2.30.0030.01217.17
7.2.20.0030.01216.90
7.2.10.0160.01016.84
7.2.00.0070.01018.14
7.1.250.0040.01115.75
7.1.200.0100.00315.82
7.1.100.0040.00718.35
7.1.70.0080.00317.41
7.1.60.0170.00719.17
7.1.50.0130.01317.30
7.1.00.0000.03722.46
7.0.200.0000.00716.84
7.0.140.0030.07322.14
7.0.60.0070.05020.01
7.0.50.0070.03717.89
7.0.40.0100.08019.93
7.0.30.0530.07320.15
7.0.20.0230.07720.11
7.0.10.0330.05720.30
7.0.00.0070.03720.21
5.6.280.0070.07020.90
5.6.210.0130.05320.66
5.6.200.0070.03718.17
5.6.190.0070.08320.61
5.6.180.0270.06720.61
5.6.170.0270.08020.62
5.6.160.0070.04320.71
5.6.150.0070.06018.09
5.6.140.0170.07318.15
5.6.130.0130.07718.16
5.6.120.0070.04721.00
5.6.110.0000.09321.00
5.6.100.0100.08021.13
5.6.90.0030.07320.95
5.6.80.0130.04720.52
5.6.70.0370.05320.27
5.5.350.0170.08720.32
5.5.340.0130.08017.97
5.5.330.0130.07720.08
5.5.320.0270.06020.25
5.5.310.0300.05320.24
5.5.300.0100.07717.96
5.5.290.0170.07317.91
5.5.280.0100.07720.73
5.5.270.0100.08020.86
5.5.260.0000.04320.86
5.5.250.0100.07720.56
5.5.240.0130.06020.35
5.4.450.0330.05319.54
5.4.440.0370.04719.54
5.4.430.0330.07019.41
5.4.420.0330.07719.57
5.4.410.0330.04019.25
5.4.400.0370.04719.14
5.4.390.0170.04319.19
5.4.380.0230.03319.10
5.4.370.0300.03318.92
5.4.360.0270.03719.24
5.4.350.0370.06319.06
5.4.340.0370.05019.09
5.4.320.0430.04019.16
5.4.310.0400.05719.13
5.4.300.0300.03718.79
5.4.290.0300.04019.05
5.4.280.0270.05019.24
5.4.270.0300.04019.13
5.4.260.0270.04019.17
5.4.250.0430.05019.07
5.4.240.0500.05319.07
5.4.230.0330.06018.80
5.4.220.0370.06718.82
5.4.210.0300.05018.80
5.4.200.0300.05018.88
5.4.190.0270.05019.07
5.4.180.0330.07019.04
5.4.170.0400.04718.88
5.4.160.0400.03319.07
5.4.150.0300.07018.89
5.4.140.0230.03716.60
5.4.130.0300.04016.48
5.4.120.0270.04316.48
5.4.110.0330.03716.26
5.4.100.0330.04016.44
5.4.90.0430.06316.51
5.4.80.0300.03716.23
5.4.70.0370.05716.53
5.4.60.0300.05316.40
5.4.50.0200.04316.40
5.4.40.0230.03716.31
5.4.30.0270.05316.04
5.4.20.0230.05016.41
5.4.10.0330.03716.36
5.4.00.0270.05015.61
5.3.290.0270.04014.52
5.3.280.0330.04014.47
5.3.270.0370.03314.43
5.3.260.0230.04714.56
5.3.250.0230.04014.44
5.3.240.0370.06714.46
5.3.230.0370.06314.51
5.3.220.0370.02714.59
5.3.210.0270.05014.41
5.3.200.0300.04714.50
5.3.190.0300.07314.44
5.3.180.0370.07014.39
5.3.170.0300.04014.40
5.3.160.0330.03314.47
5.3.150.0330.06314.51
5.3.140.0230.04014.42
5.3.130.0400.07014.50
5.3.120.0270.05714.50
5.3.110.0270.04314.41
5.3.100.0400.03713.90
5.3.90.0300.03013.86
5.3.80.0270.03313.89
5.3.70.0300.03014.00
5.3.60.0230.04013.94
5.3.50.0330.03714.04
5.3.40.0200.03713.80
5.3.30.0200.03313.75
5.3.20.0230.03713.54
5.3.10.0300.02713.59
5.3.00.0230.03313.59
5.2.170.0200.03011.24
5.2.160.0170.03011.24
5.2.150.0200.02711.24
5.2.140.0170.03011.24
5.2.130.0230.02011.24
5.2.120.0200.03011.24
5.2.110.0170.02711.24
5.2.100.0170.02711.24
5.2.90.0130.03011.24
5.2.80.0270.02311.24
5.2.70.0200.02711.24
5.2.60.0230.03011.24
5.2.50.0200.03011.24
5.2.40.0130.03011.24
5.2.30.0170.03711.24
5.2.20.0170.02311.24
5.2.10.0130.02711.24
5.2.00.0100.03011.24
5.1.60.0170.02311.24
5.1.50.0170.02011.24
5.1.40.0170.02011.24
5.1.30.0170.02311.24
5.1.20.0130.03011.24
5.1.10.0170.02311.24
5.1.00.0200.02011.24
5.0.50.0100.02311.24
5.0.40.0070.02011.24
5.0.30.0100.05311.24
5.0.20.0070.02011.24
5.0.10.0070.02011.24
5.0.00.0070.03711.24
4.4.90.0070.01311.24
4.4.80.0070.02011.24
4.4.70.0030.01711.24
4.4.60.0100.01311.24
4.4.50.0070.01311.24
4.4.40.0070.02311.24
4.4.30.0030.01711.24
4.4.20.0100.01711.24
4.4.10.0000.02311.24
4.4.00.0070.03011.24
4.3.110.0030.01711.24
4.3.100.0030.01711.24
4.3.90.0070.01311.24
4.3.80.0070.02311.24
4.3.70.0100.01011.24
4.3.60.0030.01711.24
4.3.50.0030.01711.24
4.3.40.0070.02311.24
4.3.30.0030.01711.24
4.3.20.0030.01711.24
4.3.10.0030.02011.24
4.3.00.0030.01711.24

preferences:
46.42 ms | 400 KiB | 5 Q