3v4l.org

run code in 300+ PHP versions simultaneously
<?php // CHANGE THIS $url = '/inquiry/'; $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', ], ], 'index' => [ 'pattern' => '#^/(?P<controller>[^/\\\\.,;?\n]+)#', 'default' => [ 'resource' => 'indeksi', 'action' => 'index', ], ], ]; $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.0030.01716.88
8.3.50.0090.01221.35
8.3.40.0150.00419.01
8.3.30.0070.00719.02
8.3.20.0000.00818.95
8.3.10.0050.00321.90
8.3.00.0030.00517.91
8.2.180.0110.00816.63
8.2.170.0100.01022.96
8.2.160.0090.00621.19
8.2.150.0060.00324.18
8.2.140.0030.00524.66
8.2.130.0030.00618.21
8.2.120.0090.00026.35
8.2.110.0050.00520.52
8.2.100.0090.00318.10
8.2.90.0050.00318.22
8.2.80.0000.00817.97
8.2.70.0030.00617.88
8.2.60.0040.00418.05
8.2.50.0050.00318.07
8.2.40.0080.00020.01
8.2.30.0000.00818.20
8.2.20.0000.00818.06
8.2.10.0040.00418.09
8.2.00.0040.00418.15
8.1.280.0120.00625.92
8.1.270.0040.00423.88
8.1.260.0080.00028.09
8.1.250.0110.00728.09
8.1.240.0030.00622.06
8.1.230.0060.00622.69
8.1.220.0040.00417.76
8.1.210.0040.00418.92
8.1.200.0050.00517.36
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0000.00818.33
8.1.160.0000.00722.05
8.1.150.0000.00718.93
8.1.140.0040.00419.53
8.1.130.0030.00617.80
8.1.120.0000.00717.60
8.1.110.0030.00617.63
8.1.100.0030.00417.59
8.1.90.0000.00817.65
8.1.80.0050.00217.52
8.1.70.0000.00817.59
8.1.60.0000.00817.75
8.1.50.0030.00517.70
8.1.40.0060.00617.66
8.1.30.0040.00417.66
8.1.20.0030.00517.80
8.1.10.0030.00517.75
8.1.00.0020.00517.63
8.0.300.0040.00420.04
8.0.290.0060.00317.00
8.0.280.0030.00318.40
8.0.270.0070.00317.19
8.0.260.0000.00717.28
8.0.250.0000.00717.08
8.0.240.0030.00317.16
8.0.230.0040.00417.18
8.0.220.0000.00817.13
8.0.210.0000.00717.11
8.0.200.0000.00817.18
8.0.190.0080.00017.20
8.0.180.0040.00417.11
8.0.170.0050.00217.02
8.0.160.0040.00417.14
8.0.150.0000.00716.93
8.0.140.0020.00517.04
8.0.130.0000.00613.61
8.0.120.0000.00717.11
8.0.110.0030.00617.09
8.0.100.0000.00717.23
8.0.90.0040.00417.16
8.0.80.0070.01017.16
8.0.70.0070.00017.18
8.0.60.0040.00417.05
8.0.50.0050.00217.02
8.0.30.0080.00817.31
8.0.20.0120.01317.45
8.0.10.0080.00017.19
8.0.00.0120.00616.66
7.4.330.0050.00015.08
7.4.320.0000.00716.86
7.4.300.0000.00716.84
7.4.290.0030.00316.85
7.4.280.0000.01016.73
7.4.270.0000.00716.64
7.4.260.0000.00716.72
7.4.250.0030.00616.84
7.4.240.0000.00716.73
7.4.230.0030.00316.84
7.4.220.0170.00716.88
7.4.210.0070.01116.84
7.4.200.0040.00416.64
7.4.160.0120.00616.70
7.4.150.0100.01317.40
7.4.140.0090.00817.86
7.4.130.0120.00716.63
7.4.120.0080.01316.72
7.4.110.0200.02716.74
7.4.100.0070.01116.60
7.4.90.0170.00016.79
7.4.80.0100.00919.39
7.4.70.0090.00816.78
7.4.60.0030.01417.04
7.4.50.0020.00816.55
7.4.40.0100.01016.86
7.4.30.0190.00616.79
7.4.00.0030.01415.02
7.3.330.0000.00613.36
7.3.320.0050.00213.47
7.3.310.0080.00016.55
7.3.300.0030.00316.41
7.3.290.0080.00716.49
7.3.280.0080.00716.49
7.3.270.0140.01117.40
7.3.260.0140.00616.59
7.3.250.0160.00716.71
7.3.240.0070.01016.81
7.3.230.0160.00316.43
7.3.210.0130.00316.50
7.3.200.0030.01216.65
7.3.190.0100.01016.48
7.3.180.0030.01416.49
7.3.170.0060.01116.79
7.3.160.0100.00716.52
7.2.330.0120.00616.87
7.2.320.0000.01716.96
7.2.310.0090.00916.83
7.2.300.0070.01016.77
7.2.290.0160.00716.92
7.2.60.0080.00816.82
7.2.50.0000.01317.19
7.2.00.0120.01219.09
7.1.200.0070.00715.84
7.1.100.0030.00918.50
7.1.70.0040.00417.48
7.1.60.0100.01619.33
7.1.00.0030.07722.36
7.0.200.0000.00716.96
7.0.60.0030.07721.68
7.0.50.0070.08020.32
7.0.40.0200.06020.40
7.0.30.0230.06320.29
7.0.20.0500.05320.30
7.0.10.0430.06020.43
7.0.00.0230.06020.31
5.6.280.0030.07321.10
5.6.210.0130.06320.54
5.6.200.0300.06721.12
5.6.190.0330.07321.00
5.6.180.0430.06321.08
5.6.170.0330.05021.07
5.6.160.0230.05321.16
5.6.150.0100.07721.04
5.6.140.0430.07721.09
5.6.130.0600.06721.06
5.6.120.0270.06321.15
5.6.110.0270.08321.04
5.6.100.0170.06321.16
5.6.90.0430.07021.13
5.6.80.0270.07720.44
5.6.70.0330.07320.40
5.6.60.0130.07020.49
5.6.50.0270.05720.40
5.6.40.0400.06320.48
5.6.30.0300.08320.42
5.6.20.0200.06720.52
5.6.10.0300.09020.55
5.6.00.0200.07020.46
5.5.350.0100.08020.44
5.5.340.0270.07320.72
5.5.330.0030.07720.70
5.5.320.0270.06720.87
5.5.310.0270.05720.99
5.5.300.0330.06320.86
5.5.290.0570.06720.96
5.5.280.0330.07320.85
5.5.270.0300.07020.85
5.5.260.0230.08320.86
5.5.250.0430.06020.66
5.5.240.0300.07320.40
5.5.230.0370.07320.42
5.5.220.0370.05720.42
5.5.210.0300.07020.20
5.5.200.0270.08720.23
5.5.190.0300.06720.18
5.5.180.0130.07020.18
5.5.160.0330.07720.19
5.5.150.0400.06020.18
5.5.140.0070.08320.38
5.5.130.0400.07320.25
5.5.120.0530.05320.20
5.5.110.0600.05720.11
5.5.100.0470.06720.16
5.5.90.0470.05720.19
5.5.80.0600.06720.20
5.5.70.0370.09020.16
5.5.60.0430.07720.18
5.5.50.0600.06020.11
5.5.40.0570.04720.25
5.5.30.0570.07320.14
5.5.20.0370.06020.05
5.5.10.0430.06320.00
5.5.00.0330.07020.07

preferences:
58.03 ms | 401 KiB | 5 Q