3v4l.org

run code in 300+ PHP versions simultaneously
<?php // CHANGE THIS $url = '/12345/product'; $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.4.20.0140.00717.66
8.4.10.0100.01017.95
8.3.150.0120.00617.25
8.3.140.0000.00816.70
8.3.130.0080.00017.05
8.3.120.0060.01219.26
8.3.110.0060.00320.94
8.3.100.0090.00024.06
8.3.90.0040.00426.77
8.3.80.0080.00416.88
8.3.70.0030.01716.75
8.3.60.0100.00316.63
8.3.50.0080.01422.22
8.3.40.0180.00018.92
8.3.30.0090.00619.04
8.3.20.0090.00020.29
8.3.10.0000.00823.70
8.3.00.0060.00319.48
8.2.270.0110.00717.20
8.2.260.0090.00916.82
8.2.250.0130.00616.80
8.2.240.0130.00317.38
8.2.230.0030.00622.58
8.2.220.0100.01037.54
8.2.210.0100.01026.77
8.2.200.0060.00316.88
8.2.190.0120.00616.63
8.2.180.0080.00818.53
8.2.170.0120.00322.96
8.2.160.0110.00722.96
8.2.150.0090.00025.66
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0040.00422.20
8.2.110.0000.01119.30
8.2.100.0090.00318.03
8.2.90.0030.00518.28
8.2.80.0040.00419.14
8.2.70.0080.00017.88
8.2.60.0040.00417.75
8.2.50.0040.00417.93
8.2.40.0000.00818.16
8.2.30.0040.00419.85
8.2.20.0000.00717.97
8.2.10.0040.00418.09
8.2.00.0050.00517.84
8.1.310.0030.00616.85
8.1.300.0060.01317.80
8.1.290.0130.00718.88
8.1.280.0120.00625.92
8.1.270.0050.00224.66
8.1.260.0030.00626.35
8.1.250.0000.00928.09
8.1.240.0060.00323.97
8.1.230.0080.00321.04
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.48
8.1.180.0060.00318.10
8.1.170.0060.00317.62
8.1.160.0080.00021.92
8.1.150.0040.00418.86
8.1.140.0000.00817.48
8.1.130.0000.00717.52
8.1.120.0040.00417.51
8.1.110.0060.00317.65
8.1.100.0040.00417.56
8.1.90.0040.00417.67
8.1.80.0060.00317.61
8.1.70.0040.00417.62
8.1.60.0000.00817.75
8.1.50.0030.00617.60
8.1.40.0000.00817.68
8.1.30.0050.00317.68
8.1.20.0050.00317.82
8.1.10.0000.00817.63
8.1.00.0000.00817.64
8.0.300.0040.00420.00
8.0.290.0000.00816.88
8.0.280.0040.00418.50
8.0.270.0070.00017.09
8.0.260.0030.00317.06
8.0.250.0070.00017.14
8.0.240.0000.00917.16
8.0.230.0030.00317.20
8.0.220.0070.00017.00
8.0.210.0000.00717.09
8.0.200.0000.00717.20
8.0.190.0000.00817.23
8.0.180.0000.00717.17
8.0.170.0030.00517.08
8.0.160.0040.00417.00
8.0.150.0000.00817.14
8.0.140.0020.00517.07
8.0.130.0000.00513.49
8.0.120.0080.00017.08
8.0.110.0050.00217.11
8.0.100.0000.00716.96
8.0.90.0030.00617.02
8.0.80.0030.01317.18
8.0.70.0040.00417.12
8.0.60.0000.00817.15
8.0.50.0030.00517.01
8.0.30.0130.00517.09
8.0.20.0100.01017.40
8.0.10.0000.00717.28
8.0.00.0160.00317.11
7.4.330.0000.00615.04
7.4.320.0030.00316.82
7.4.300.0070.00016.79
7.4.290.0070.00016.74
7.4.280.0080.00016.73
7.4.270.0040.00416.82
7.4.260.0040.00416.70
7.4.250.0030.00316.71
7.4.240.0020.00616.78
7.4.230.0070.00016.59
7.4.220.0060.01216.80
7.4.210.0060.00816.74
7.4.200.0000.00816.63
7.4.190.0070.00016.97
7.4.160.0130.00316.91
7.4.150.0120.00617.40
7.4.140.0120.00817.86
7.4.130.0060.01616.67
7.4.120.0160.00516.87
7.4.110.0070.01116.67
7.4.100.0060.01616.95
7.4.90.0080.01016.91
7.4.80.0000.02019.39
7.4.70.0100.00616.70
7.4.60.0040.01516.68
7.4.50.0040.00416.59
7.4.40.0160.00616.54
7.4.30.0130.00416.73
7.4.10.0110.00715.05
7.4.00.0080.01014.98
7.3.330.0000.00613.39
7.3.320.0030.00313.17
7.3.310.0040.00416.34
7.3.300.0040.00416.49
7.3.290.0060.01416.48
7.3.280.0070.01016.53
7.3.270.0120.00617.40
7.3.260.0100.00716.57
7.3.250.0140.00716.63
7.3.240.0080.01716.80
7.3.230.0130.00616.61
7.3.210.0090.01316.70
7.3.200.0040.01619.39
7.3.190.0090.01516.57
7.3.180.0090.00816.78
7.3.170.0040.01816.44
7.3.160.0130.00416.72
7.3.130.0100.01015.04
7.3.120.0100.00715.03
7.3.110.0070.00715.18
7.3.100.0090.00315.04
7.3.90.0040.01415.22
7.3.80.0070.00714.71
7.3.70.0080.00414.88
7.3.60.0030.01315.12
7.3.50.0130.00315.15
7.3.40.0030.01015.04
7.3.30.0080.00414.98
7.3.20.0070.00717.07
7.3.10.0050.00716.73
7.3.00.0080.00616.87
7.2.330.0250.00316.72
7.2.320.0130.00316.72
7.2.310.0160.00816.92
7.2.300.0130.00316.71
7.2.290.0100.01116.80
7.2.260.0070.01115.19
7.2.250.0030.01215.17
7.2.240.0090.00615.18
7.2.230.0030.01315.32
7.2.220.0120.00615.30
7.2.210.0030.00915.22
7.2.200.0120.00314.87
7.2.190.0030.00915.15
7.2.180.0070.00315.13
7.2.170.0040.01115.37
7.2.160.0100.00315.22
7.2.150.0080.00417.05
7.2.140.0110.00416.92
7.2.130.0130.00817.10
7.2.120.0100.00816.99
7.2.110.0050.00916.99
7.2.100.0080.00717.06
7.2.90.0090.01016.99
7.2.80.0070.01017.07
7.2.70.0060.01217.13
7.2.60.0050.01117.02
7.2.50.0060.01017.10
7.2.40.0090.00717.08
7.2.30.0080.01017.23
7.2.20.0060.01017.24
7.2.10.0170.00917.37
7.2.00.0070.00917.64
7.1.330.0070.00716.04
7.1.320.0000.01615.86
7.1.310.0040.00816.05
7.1.300.0030.00715.80
7.1.290.0090.00616.14
7.1.280.0000.00815.88
7.1.270.0060.00915.91
7.1.260.0040.00416.13
7.1.250.0080.00715.94
7.1.240.0090.00315.88
7.1.230.0060.00315.70
7.1.220.0100.00315.66
7.1.210.0040.00716.09
7.1.200.0030.01315.87
7.1.190.0030.00915.88
7.1.180.0040.01215.86
7.1.170.0040.01115.67
7.1.160.0070.00715.82
7.1.150.0050.01516.52
7.1.140.0070.01316.71
7.1.130.0060.01216.40
7.1.120.0120.00716.59
7.1.110.0090.00716.41
7.1.100.0370.01016.43
7.1.90.0080.01116.07
7.1.80.0060.01016.13
7.1.70.0220.00915.85
7.1.60.0290.00921.71
7.1.50.0330.00921.52
7.1.40.0210.01121.41
7.1.30.0350.01321.45
7.1.20.0250.01321.43
7.1.10.0230.00815.24
7.1.00.0250.00615.39
7.0.330.0030.01015.40
7.0.320.0120.00315.63
7.0.310.0070.00715.54
7.0.300.0060.00915.54
7.0.290.0070.00415.35
7.0.280.0080.00815.61
7.0.270.0050.01516.03
7.0.260.0090.00816.01
7.0.250.0090.00915.86
7.0.240.0090.01016.00
7.0.230.0070.00915.76
7.0.220.0160.00515.83
7.0.210.0050.01515.23
7.0.200.0470.00815.40
7.0.190.0240.01115.37
7.0.180.0230.00515.12
7.0.170.0220.01015.16
7.0.160.0230.00815.20
7.0.150.0190.01015.09
7.0.140.0230.00915.15
7.0.130.0270.00715.07
7.0.120.0260.00715.10
7.0.110.0260.00815.07
7.0.100.0210.00815.16
7.0.90.0210.00815.24
7.0.80.0230.00915.17
7.0.70.0280.00615.05
7.0.60.0600.00715.68
7.0.50.0080.00715.86
7.0.40.0070.01014.45
7.0.30.0050.01014.61
7.0.20.0100.00714.56
7.0.10.0110.01014.59
7.0.00.0100.00714.45
5.6.400.0030.00614.70
5.6.390.0040.01114.41
5.6.380.0040.01114.41
5.6.370.0100.00314.68
5.6.360.0030.01014.19
5.6.350.0000.01014.39
5.6.340.0030.00614.30
5.6.330.0030.01314.34
5.6.320.0000.01414.35
5.6.310.0030.01014.40
5.6.300.0110.04018.61
5.6.290.0130.04318.67
5.6.280.0130.04318.85
5.6.270.0110.04618.79
5.6.260.0130.03518.65
5.6.250.0140.03518.78
5.6.240.0090.04218.72
5.6.230.0100.03918.76
5.6.220.0120.04018.80
5.6.210.0120.03518.77
5.6.200.0090.04118.67
5.6.190.0110.04218.83
5.6.180.0140.03918.67
5.6.170.0130.04218.76
5.6.160.0110.04418.63
5.6.150.0110.03918.82
5.6.140.0100.04518.67
5.6.130.0100.03818.76
5.6.120.0150.04018.71
5.6.110.0090.04118.63
5.6.100.0100.04018.88
5.6.90.0170.03818.58
5.6.80.0090.03918.22
5.6.70.0090.04118.24
5.6.60.0120.04418.22
5.6.50.0120.04118.29
5.6.40.0080.04418.24
5.6.30.0080.05118.37
5.6.20.0080.03718.37
5.6.10.0120.03618.29
5.6.00.0130.03518.22
5.5.380.0130.05517.53
5.5.370.0140.06417.48
5.5.360.0140.05917.42
5.5.350.0100.05117.44
5.5.340.0130.05318.00
5.5.330.0130.07617.71
5.5.320.0150.05918.00
5.5.310.0110.05117.99
5.5.300.0090.06817.89
5.5.290.0230.05617.79
5.5.280.0110.06317.79
5.5.270.0080.06817.94
5.5.260.0110.05617.79
5.5.250.0110.05417.79
5.5.240.0140.04717.20
5.5.230.0120.04717.33
5.5.220.0120.05217.26
5.5.210.0120.05317.20
5.5.200.0120.05517.46
5.5.190.0160.04717.38
5.5.180.0130.05717.39
5.5.160.0100.05517.17
5.5.150.0070.05817.29
5.5.140.0050.05217.38
5.5.130.0140.05917.34
5.5.120.0120.04517.26
5.5.110.0110.06817.35
5.5.100.0130.04817.23
5.5.90.0130.04417.10
5.5.80.0100.04517.24
5.5.70.0160.04817.10
5.5.60.0110.04817.14
5.5.50.0090.05417.21
5.5.40.0100.05417.21
5.5.30.0140.04617.13
5.5.20.0100.05617.17
5.5.10.0120.05617.18
5.5.00.0170.04917.02
5.4.450.0100.05719.40
5.4.440.0140.05419.26
5.4.430.0100.05619.32
5.4.420.0080.05419.31
5.4.410.0110.04619.18
5.4.400.0110.04719.09
5.4.390.0150.05818.94
5.4.380.0100.05319.07
5.4.370.0100.05719.00
5.4.360.0210.05019.09
5.4.350.0110.05119.07
5.4.340.0100.06218.95
5.4.320.0160.04919.06
5.4.310.0100.04518.95
5.4.300.0130.04818.96
5.4.290.0130.04618.93
5.4.280.0170.04719.04
5.4.270.0110.04719.01
5.4.260.0140.05318.79
5.4.250.0120.05019.06
5.4.240.0140.04618.94
5.4.230.0080.04719.07
5.4.220.0090.05118.93
5.4.210.0110.04619.00
5.4.200.0120.04818.98
5.4.190.0090.05718.92
5.4.180.0130.04818.97
5.4.170.0110.05518.86
5.4.160.0150.05518.96
5.4.150.0100.05919.00
5.4.140.0170.05416.47
5.4.130.0120.04816.53
5.4.120.0130.04916.47
5.4.110.0090.04416.64
5.4.100.0140.04416.68
5.4.90.0090.05016.58
5.4.80.0150.04816.45
5.4.70.0130.05416.63
5.4.60.0070.05316.41
5.4.50.0130.04716.55
5.4.40.0080.05016.65
5.4.30.0100.04116.36
5.4.20.0110.04216.46
5.4.10.0130.04916.45
5.4.00.0080.05015.85
5.3.290.0100.05715.00
5.3.280.0110.05514.87
5.3.270.0110.05714.96
5.3.260.0100.04414.84
5.3.250.0100.05914.88
5.3.240.0060.05114.96
5.3.230.0140.04414.92
5.3.220.0090.05114.95
5.3.210.0130.05214.85
5.3.200.0090.04814.85
5.3.190.0100.05814.77
5.3.180.0100.04414.94
5.3.170.0120.05214.89
5.3.160.0110.04614.76
5.3.150.0100.04514.85
5.3.140.0060.04714.94
5.3.130.0100.05514.87
5.3.120.0120.04514.95
5.3.110.0120.04714.85
5.3.100.0090.04714.64
5.3.90.0030.05014.58
5.3.80.0110.05114.61
5.3.70.0080.04414.67
5.3.60.0140.04414.66
5.3.50.0080.04414.51
5.3.40.0090.04814.54
5.3.30.0080.04714.59
5.3.20.0100.04614.47
5.3.10.0120.04814.44
5.3.00.0060.05214.50
5.2.170.0070.03713.22
5.2.160.0070.03513.14
5.2.150.0080.04613.22
5.2.140.0050.03713.22
5.2.130.0070.04413.22
5.2.120.0100.03413.12
5.2.110.0060.04613.18
5.2.100.0060.03513.10
5.2.90.0080.03813.24
5.2.80.0120.03213.09
5.2.70.0100.04313.14
5.2.60.0080.04513.18
5.2.50.0070.04313.11
5.2.40.0080.03613.17
5.2.30.0090.04513.11
5.2.20.0090.03813.12
5.2.10.0090.03213.08
5.2.00.0050.03712.99
5.1.60.0110.03012.57
5.1.50.0070.03312.64
5.1.40.0070.04012.60
5.1.30.0070.03812.68
5.1.20.0080.03112.90
5.1.10.0100.03412.70
5.1.00.0080.03612.76
5.0.50.0070.03112.13
5.0.40.0030.02812.13
5.0.30.0070.04712.13
5.0.20.0090.02612.13
5.0.10.0060.03012.13
5.0.00.0070.04112.13
4.4.90.0070.01912.13
4.4.80.0030.01912.13
4.4.70.0050.01812.13
4.4.60.0060.01712.13
4.4.50.0050.02012.13
4.4.40.0020.03512.13
4.4.30.0050.02112.13
4.4.20.0050.02112.13
4.4.10.0060.02512.13
4.4.00.0050.03412.13
4.3.110.0070.02012.13
4.3.100.0050.02212.13
4.3.90.0010.02212.13
4.3.80.0040.03312.13
4.3.70.0050.01812.13
4.3.60.0080.01412.13
4.3.50.0050.01912.13
4.3.40.0070.02712.13
4.3.30.0020.02112.13
4.3.20.0010.02312.13
4.3.10.0030.02112.13
4.3.00.0020.02012.13

preferences:
29.9 ms | 403 KiB | 5 Q