3v4l.org

run code in 300+ PHP versions simultaneously
<?php // CHANGE THIS $url = '/1234/produc'; $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 print_r( $current ); print_r( $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.0120.00918.43
8.3.50.0060.01222.30
8.3.40.0050.01418.80
8.3.30.0150.00018.66
8.3.20.0040.00419.02
8.3.10.0000.00821.10
8.3.00.0040.00419.66
8.2.180.0110.00416.75
8.2.170.0040.01322.96
8.2.160.0030.01020.39
8.2.150.0000.00824.18
8.2.140.0070.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00421.13
8.2.110.0040.00420.29
8.2.100.0030.00818.16
8.2.90.0040.00419.24
8.2.80.0040.00417.97
8.2.70.0040.00817.88
8.2.60.0000.00818.05
8.2.50.0050.00318.07
8.2.40.0060.00318.16
8.2.30.0070.00021.30
8.2.20.0040.00417.88
8.2.10.0080.00017.84
8.2.00.0060.00317.94
8.1.280.0100.00725.92
8.1.270.0030.00523.99
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0040.00422.64
8.1.230.0060.00620.91
8.1.220.0000.00918.77
8.1.210.0040.00418.91
8.1.200.0030.00617.50
8.1.190.0000.00817.39
8.1.180.0060.00318.10
8.1.170.0000.00818.62
8.1.160.0080.00018.97
8.1.150.0000.00818.81
8.1.140.0090.00017.70
8.1.130.0030.00317.86
8.1.120.0070.00017.51
8.1.110.0000.00717.55
8.1.100.0000.00717.50
8.1.90.0000.00717.48
8.1.80.0000.00717.51
8.1.70.0000.00717.53
8.1.60.0090.00017.72
8.1.50.0000.00817.60
8.1.40.0030.00517.59
8.1.30.0000.00817.79
8.1.20.0090.00017.72
8.1.10.0040.00417.78
8.1.00.0030.00617.56
8.0.300.0050.00319.93
8.0.290.0080.00017.18
8.0.280.0000.00718.49
8.0.270.0070.00017.20
8.0.260.0050.00316.95
8.0.250.0000.00717.16
8.0.240.0060.00317.16
8.0.230.0030.00317.17
8.0.220.0040.00417.15
8.0.210.0000.00717.09
8.0.200.0030.00317.06
8.0.190.0050.00317.14
8.0.180.0000.00717.19
8.0.170.0040.00417.02
8.0.160.0000.00817.10
8.0.150.0050.00317.04
8.0.140.0040.00416.96
8.0.130.0030.00313.55
8.0.120.0050.00317.13
8.0.110.0070.00017.14
8.0.100.0000.00716.98
8.0.90.0000.00717.13
8.0.80.0130.00717.14
8.0.70.0030.00516.99
8.0.60.0040.00417.08
8.0.50.0050.00317.14
8.0.30.0090.01217.32
8.0.20.0070.01217.47
8.0.10.0080.00017.26
8.0.00.0110.00816.89
7.4.330.0020.00214.95
7.4.320.0000.00616.82
7.4.300.0060.00016.64
7.4.290.0030.00316.75
7.4.280.0000.00816.73
7.4.270.0030.00316.73
7.4.260.0000.00513.36
7.4.250.0040.00416.70
7.4.240.0070.00016.89
7.4.230.0000.00716.63
7.4.220.0100.01016.78
7.4.210.0110.00516.76
7.4.200.0000.00716.76
7.4.190.0000.00816.98
7.4.160.0100.01016.63
7.4.150.0070.01117.40
7.4.140.0100.00817.86
7.4.130.0090.00816.80
7.4.120.0080.00816.68
7.4.110.0090.00916.60
7.4.100.0180.00316.69
7.4.90.0120.00616.72
7.4.80.0140.01019.39
7.4.70.0060.01116.71
7.4.60.0060.01016.62
7.4.50.0060.00316.68
7.4.40.0070.01022.77
7.4.30.0030.01616.72
7.4.10.0060.01214.94
7.4.00.0050.01114.98
7.3.330.0050.00013.29
7.3.320.0000.00613.33
7.3.310.0000.00816.59
7.3.300.0070.00016.45
7.3.290.0040.01116.53
7.3.280.0090.00716.47
7.3.270.0140.00417.40
7.3.260.0100.01118.24
7.3.250.0050.01316.53
7.3.240.0070.01016.65
7.3.230.0040.01516.54
7.3.210.0000.01716.48
7.3.200.0120.00919.39
7.3.190.0060.01216.45
7.3.180.0070.01016.70
7.3.170.0170.00316.67
7.3.160.0060.01216.46
7.3.130.0000.01915.20
7.3.120.0040.01215.04
7.3.110.0030.01615.20
7.3.100.0120.00615.02
7.3.90.0080.00514.97
7.3.80.0030.00715.08
7.3.70.0000.01715.01
7.3.60.0100.00314.88
7.3.50.0090.00615.09
7.3.40.0030.00714.88
7.3.30.0000.01414.92
7.3.20.0080.00616.96
7.3.10.0090.01116.80
7.3.00.0060.00816.64
7.2.330.0090.00916.68
7.2.320.0060.01217.04
7.2.310.0090.01016.68
7.2.300.0120.00816.81
7.2.290.0120.00616.95
7.2.260.0110.00715.05
7.2.250.0060.01215.21
7.2.240.0000.01615.13
7.2.230.0110.00415.16
7.2.220.0060.00915.22
7.2.210.0070.00715.28
7.2.200.0110.00715.11
7.2.190.0070.00714.82
7.2.180.0030.00915.06
7.2.170.0000.01115.16
7.2.160.0070.00715.23
7.2.150.0000.00917.15
7.2.140.0080.00316.74
7.2.130.0100.00817.16
7.2.120.0120.00816.67
7.2.110.0100.00816.78
7.2.100.0100.00816.73
7.2.90.0120.01217.24
7.2.80.0200.00516.58
7.2.70.0140.00716.84
7.2.60.0080.01217.12
7.2.50.0140.00516.94
7.2.40.0100.00516.78
7.2.30.0170.00416.82
7.2.20.0080.00616.86
7.2.10.0090.01316.80
7.2.00.0070.01016.98
7.1.330.0030.01315.70
7.1.320.0000.01315.64
7.1.310.0080.00815.95
7.1.300.0030.01016.05
7.1.290.0060.00316.22
7.1.280.0030.01015.55
7.1.270.0030.01015.90
7.1.260.0070.00516.01
7.1.250.0120.00515.70
7.1.240.0040.01115.76
7.1.230.0100.01015.99
7.1.220.0060.00916.04
7.1.210.0150.00015.94
7.1.200.0000.01115.88
7.1.190.0030.01015.55
7.1.180.0000.01315.80
7.1.170.0040.01115.58
7.1.160.0030.01015.92
7.1.150.0060.00615.90
7.1.140.0040.00815.90
7.1.130.0070.00715.89
7.1.120.0030.01216.09
7.1.110.0090.00615.85
7.1.100.0060.01115.97
7.1.90.0040.01516.11
7.1.80.0070.00415.95
7.1.70.0060.00816.78
7.1.60.0060.00617.60
7.1.50.0050.01416.27
7.1.40.0000.01415.73
7.1.30.0080.00316.05
7.1.20.0030.01016.23
7.1.10.0040.01215.75
7.1.00.0030.02719.13
7.0.330.0110.00415.53
7.0.320.0030.01615.50
7.0.310.0070.00715.29
7.0.300.0070.00415.53
7.0.290.0070.00315.48
7.0.280.0070.00715.53
7.0.270.0000.01715.53
7.0.260.0000.01415.48
7.0.250.0030.01215.52
7.0.240.0030.01415.57
7.0.230.0090.00315.17
7.0.220.0090.00915.39
7.0.210.0040.01215.32
7.0.200.0040.00716.32
7.0.190.0110.00615.41
7.0.180.0030.01315.60
7.0.170.0030.01015.74
7.0.160.0060.00915.73
7.0.150.0040.01315.48
7.0.140.0040.03918.78
7.0.130.0120.00015.64
7.0.120.0060.00815.58
7.0.110.0120.04018.68
7.0.100.0030.04918.54
7.0.90.0100.04318.69
7.0.80.0040.04918.68
7.0.70.0040.02418.71
7.0.60.0080.03218.70
7.0.50.0070.03418.70
7.0.40.0070.04516.60
7.0.30.0050.05116.70
7.0.20.0060.03116.70
7.0.10.0060.03216.72
7.0.00.0070.04016.73
5.6.400.0030.01014.36
5.6.390.0030.00914.16
5.6.380.0040.00914.49
5.6.370.0130.00314.62
5.6.360.0090.00314.28
5.6.350.0070.00414.02
5.6.340.0030.01214.40
5.6.330.0080.00414.21
5.6.320.0000.01414.48
5.6.310.0070.00414.48
5.6.300.0070.00714.75
5.6.290.0070.00714.39
5.6.280.0030.04217.57
5.6.270.0000.01414.64
5.6.260.0070.04417.63
5.6.250.0040.05117.63
5.6.240.0070.04317.56
5.6.230.0030.04117.53
5.6.220.0050.03017.42
5.6.210.0030.03017.47
5.6.200.0040.04917.50
5.6.190.0050.04817.42
5.6.180.0060.05017.55
5.6.170.0090.03117.68
5.6.160.0070.05517.52
5.6.150.0050.02717.45
5.6.140.0060.03917.66
5.6.130.0050.02617.59
5.6.120.0060.03117.50
5.6.110.0020.03717.64
5.6.100.0090.01817.39
5.6.90.0080.01817.66
5.6.80.0020.02617.22
5.6.70.0000.02917.15
5.6.60.0030.02317.03
5.6.50.0060.02817.19
5.6.40.0070.02317.20
5.6.30.0030.02517.21
5.6.20.0030.03417.14
5.6.10.0050.02417.24
5.6.00.0050.01817.24
5.5.380.0080.02115.97
5.5.370.0020.04816.02
5.5.360.0050.03715.99
5.5.350.0060.02815.80
5.5.340.0050.04216.09
5.5.330.0030.03716.23
5.5.320.0050.04216.00
5.5.310.0030.02416.07
5.5.300.0000.02816.18
5.5.290.0000.04216.22
5.5.280.0060.02216.22
5.5.270.0030.02516.15
5.5.260.0030.03015.99
5.5.250.0060.02516.08
5.5.240.0000.02315.84
5.5.230.0060.02215.52
5.5.220.0050.01915.65
5.5.210.0070.03015.85
5.5.200.0040.02115.60
5.5.190.0060.02215.84
5.5.180.0040.02315.61
5.5.170.0120.00414.12
5.5.160.0020.02515.80
5.5.150.0030.02415.81
5.5.140.0080.02015.79
5.5.130.0060.01915.54
5.5.120.0100.01815.82
5.5.110.0120.02515.65
5.5.100.0070.02015.65
5.5.90.0070.02015.71
5.5.80.0000.02615.91
5.5.70.0080.02315.91
5.5.60.0050.02715.63
5.5.50.0080.03815.63
5.5.40.0030.02415.85
5.5.30.0080.02615.90
5.5.20.0100.02015.81
5.5.10.0080.03315.65
5.5.00.0120.02315.67
5.4.450.0040.04015.18
5.4.440.0040.02215.11
5.4.430.0030.02215.12
5.4.420.0050.02115.14
5.4.410.0040.02314.96
5.4.400.0050.02015.03
5.4.390.0050.01814.82
5.4.380.0050.01814.88
5.4.370.0070.03615.03
5.4.360.0020.02414.96
5.4.350.0070.01815.13
5.4.340.0010.02414.92
5.4.330.0030.00710.96
5.4.320.0080.01715.03
5.4.310.0030.02914.98
5.4.300.0030.02115.07
5.4.290.0060.01815.08
5.4.280.0050.02314.99
5.4.270.0080.03315.03
5.4.260.0070.03414.87
5.4.250.0040.02015.01
5.4.240.0080.02714.87
5.4.230.0040.02714.90
5.4.220.0070.03514.88
5.4.210.0030.01814.94
5.4.200.0050.03014.97
5.4.190.0060.02314.88
5.4.180.0040.02114.90
5.4.170.0060.02014.78
5.4.160.0090.01314.94
5.4.150.0060.02514.85
5.4.140.0050.01813.41
5.4.130.0060.01813.66
5.4.120.0050.02713.71
5.4.110.0020.02113.61
5.4.100.0050.01813.78
5.4.90.0050.02113.71
5.4.80.0000.02113.75
5.4.70.0030.02013.83
5.4.60.0050.01813.71
5.4.50.0030.02013.62
5.4.40.0050.02113.73
5.4.30.0020.02713.57
5.4.20.0030.01813.45
5.4.10.0060.02513.68
5.4.00.0040.03713.28
5.3.290.0030.02212.48
5.3.280.0050.01712.28
5.3.270.0080.01812.48
5.3.260.0010.02512.34
5.3.250.0020.02412.34
5.3.240.0020.02212.29
5.3.230.0020.02212.25
5.3.220.0060.02812.29
5.3.210.0030.02012.34
5.3.200.0030.02412.32
5.3.190.0000.02612.38
5.3.180.0090.03012.40
5.3.170.0030.03512.35
5.3.160.0020.02212.38
5.3.150.0020.02312.36
5.3.140.0070.02012.41
5.3.130.0050.02812.40
5.3.120.0050.02212.39
5.3.110.0000.04212.35
5.3.100.0020.02312.10
5.3.90.0070.02312.12
5.3.80.0070.01812.02
5.3.70.0060.02011.95
5.3.60.0020.02012.07
5.3.50.0030.02111.95
5.3.40.0020.02712.04
5.3.30.0040.02211.99
5.3.20.0060.03311.94
5.3.10.0020.02211.83
5.3.00.0020.01811.80
5.2.170.0030.03011.20
5.2.160.0030.06011.06
5.2.150.0000.03711.08
5.2.140.0030.02711.06
5.2.130.0070.04011.11
5.2.120.0000.03011.13
5.2.110.0000.03311.00
5.2.100.0030.02711.00
5.2.90.0000.03310.99
5.2.80.0030.02711.00
5.2.70.0000.04711.10
5.2.60.0000.03310.98
5.2.50.0000.06310.96
5.2.40.0030.03710.93
5.2.30.0000.03010.88
5.2.20.0070.02310.90
5.2.10.0000.02710.85
5.2.00.0000.06310.86
5.1.60.0030.0409.93
5.1.50.0030.0209.92
5.1.40.0000.0539.90
5.1.30.0000.05310.28
5.1.20.0000.05710.30
5.1.10.0000.06310.03
5.1.00.0030.02310.31
5.0.50.0030.0509.90
5.0.40.0070.0309.90
5.0.30.0000.0309.90
5.0.20.0000.0179.90
5.0.10.0000.0209.90
5.0.00.0030.0239.90
4.4.90.0030.0279.90
4.4.80.0000.0209.90
4.4.70.0000.0339.90
4.4.60.0000.0139.90
4.4.50.0000.0139.90
4.4.40.0000.0239.90
4.4.30.0030.0209.90
4.4.20.0000.0339.90
4.4.10.0000.0139.90
4.4.00.0000.0579.90
4.3.110.0000.0179.90
4.3.100.0000.0339.90
4.3.90.0000.0179.90
4.3.80.0000.0339.90
4.3.70.0000.0139.90
4.3.60.0030.0279.90
4.3.50.0000.0139.90
4.3.40.0030.0209.90
4.3.30.0000.0379.90
4.3.20.0000.0239.90
4.3.10.0000.0209.90
4.3.00.0000.0339.90

preferences:
35.38 ms | 401 KiB | 5 Q