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.0110.01116.88
8.3.50.0070.00716.46
8.3.40.0100.01018.95
8.3.30.0040.01118.75
8.3.20.0080.00018.93
8.3.10.0000.00821.85
8.3.00.0080.00017.91
8.2.180.0100.00716.75
8.2.170.0090.00622.96
8.2.160.0150.00021.06
8.2.150.0070.01125.66
8.2.140.0040.00424.66
8.2.130.0080.00017.97
8.2.120.0080.00026.35
8.2.110.0040.00722.38
8.2.100.0120.00018.09
8.2.90.0080.00019.34
8.2.80.0000.00917.97
8.2.70.0040.00417.88
8.2.60.0040.00418.05
8.2.50.0030.00518.07
8.2.40.0040.00418.16
8.2.30.0030.00618.14
8.2.20.0050.00317.87
8.2.10.0050.00318.13
8.2.00.0000.00718.16
8.1.280.0040.01525.92
8.1.270.0000.00723.91
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0030.00620.96
8.1.230.0120.00017.57
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0040.00417.48
8.1.190.0080.00017.36
8.1.180.0000.00818.10
8.1.170.0050.00318.73
8.1.160.0080.00022.13
8.1.150.0000.00718.89
8.1.140.0040.00419.55
8.1.130.0090.00017.67
8.1.120.0070.00017.66
8.1.110.0040.00417.61
8.1.100.0040.00417.59
8.1.90.0000.00817.48
8.1.80.0000.00717.61
8.1.70.0030.00317.52
8.1.60.0000.00917.71
8.1.50.0080.00017.67
8.1.40.0060.00617.61
8.1.30.0060.00317.87
8.1.20.0030.00517.81
8.1.10.0050.00317.64
8.1.00.0040.00417.75
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0000.00718.39
8.0.270.0060.00317.19
8.0.260.0020.00517.22
8.0.250.0070.00017.17
8.0.240.0000.00717.17
8.0.230.0000.00817.19
8.0.220.0080.00017.13
8.0.210.0030.00317.10
8.0.200.0040.00417.14
8.0.190.0030.00517.17
8.0.180.0040.00417.12
8.0.170.0030.00517.13
8.0.160.0040.00417.14
8.0.150.0030.00317.15
8.0.140.0040.00417.01
8.0.130.0030.00313.55
8.0.120.0070.00316.98
8.0.110.0040.00417.14
8.0.100.0070.00017.15
8.0.90.0040.00416.92
8.0.80.0060.00917.07
8.0.70.0030.00517.01
8.0.60.0080.00017.11
8.0.50.0040.00417.12
8.0.30.0070.01117.39
8.0.20.0120.01117.41
8.0.10.0030.00517.13
8.0.00.0060.01216.77
7.4.330.0000.00515.08
7.4.320.0070.00016.64
7.4.300.0070.00016.71
7.4.290.0070.00016.74
7.4.280.0000.01116.84
7.4.270.0000.00716.78
7.4.260.0000.00716.63
7.4.250.0040.00416.70
7.4.240.0050.00316.84
7.4.230.0030.00316.73
7.4.220.0110.01616.71
7.4.210.0100.01016.92
7.4.200.0040.00416.48
7.4.160.0080.00816.66
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0090.00816.60
7.4.120.0040.01616.83
7.4.110.0030.01816.54
7.4.100.0060.01516.71
7.4.90.0070.01116.87
7.4.80.0060.01319.39
7.4.70.0060.01216.69
7.4.60.0000.01616.67
7.4.50.0100.00616.71
7.4.40.0100.00716.92
7.4.30.0080.01116.65
7.4.10.0100.00715.12
7.4.00.0060.01115.05
7.3.330.0000.00613.29
7.3.320.0040.00413.36
7.3.310.0000.00716.64
7.3.300.0070.00016.54
7.3.290.0050.01116.47
7.3.280.0100.00816.45
7.3.270.0220.00417.40
7.3.260.0120.01316.49
7.3.250.0140.00816.54
7.3.240.0090.01316.75
7.3.230.0130.01016.54
7.3.210.0130.00316.77
7.3.200.0060.01216.62
7.3.190.0060.01316.56
7.3.180.0070.01316.68
7.3.170.0100.01316.43
7.3.160.0090.00616.66
7.3.130.0070.01115.20
7.3.120.0100.00915.12
7.3.110.0040.01515.03
7.3.100.0040.01115.13
7.3.90.0030.01215.17
7.3.80.0060.00715.21
7.3.70.0030.01114.93
7.3.60.0110.00515.06
7.3.50.0090.00414.84
7.3.40.0030.00915.01
7.3.30.0060.00515.00
7.3.20.0090.00716.93
7.3.10.0050.00716.76
7.3.00.0020.01316.90
7.2.330.0170.00016.86
7.2.320.0140.00616.94
7.2.310.0130.00916.79
7.2.300.0160.00016.95
7.2.290.0070.01416.86
7.2.260.0060.01215.34
7.2.250.0090.00915.25
7.2.240.0090.01015.22
7.2.230.0080.00815.31
7.2.220.0070.01015.38
7.2.210.0060.00915.21
7.2.200.0020.01015.25
7.2.190.0050.01115.27
7.2.180.0050.01015.26
7.2.170.0030.01215.30
7.2.160.0070.00415.33
7.2.150.0060.00917.17
7.2.140.0070.00717.09
7.2.130.0080.00516.97
7.2.120.0080.00917.07
7.2.110.0120.00517.10
7.2.100.0100.00517.05
7.2.90.0020.01017.15
7.2.80.0040.01017.14
7.2.70.0060.00617.04
7.2.60.0060.00517.20
7.2.50.0040.01017.24
7.2.40.0040.00816.94
7.2.30.0080.00817.08
7.2.20.0040.00917.23
7.2.10.0070.00717.14
7.2.00.0030.01017.90
7.1.330.0050.01116.12
7.1.320.0070.01115.97
7.1.310.0030.00815.84
7.1.300.0050.00915.95
7.1.290.0070.00615.87
7.1.280.0030.01015.96
7.1.270.0020.01215.81
7.1.260.0080.00416.07
7.1.250.0060.00815.92
7.1.240.0040.01115.98
7.1.230.0030.01015.71
7.1.220.0060.00615.87
7.1.210.0060.00316.11
7.1.200.0050.00716.01
7.1.190.0100.00416.05
7.1.180.0060.00616.07
7.1.170.0070.00715.98
7.1.160.0100.00315.95
7.1.150.0000.01216.19
7.1.140.0040.00715.97
7.1.130.0060.00915.81
7.1.120.0110.00415.77
7.1.110.0070.01016.15
7.1.100.0080.00617.09
7.1.90.0040.00715.92
7.1.80.0090.00615.84
7.1.70.0040.00716.62
7.1.60.0100.00817.75
7.1.50.0090.00315.92
7.1.40.0060.01015.89
7.1.30.0060.00616.04
7.1.20.0060.00615.98
7.1.10.0070.00716.03
7.1.00.0050.04219.28
7.0.330.0030.01215.63
7.0.320.0040.01115.66
7.0.310.0030.00815.46
7.0.300.0040.00715.73
7.0.290.0060.00915.62
7.0.280.0100.00715.63
7.0.270.0040.00815.57
7.0.260.0110.00415.27
7.0.250.0140.00015.75
7.0.240.0070.00415.73
7.0.230.0090.00615.41
7.0.220.0000.01115.80
7.0.210.0030.01315.65
7.0.200.0070.00716.22
7.0.190.0000.01015.71
7.0.180.0030.01215.70
7.0.170.0100.00315.73
7.0.160.0030.00715.59
7.0.150.0060.00615.63
7.0.140.0060.00315.62
7.0.130.0070.00715.74
7.0.120.0060.00615.68
7.0.110.0020.01115.79
7.0.100.0060.00615.76
7.0.90.0070.01015.55
7.0.80.0030.00915.74
7.0.70.0000.01215.72
7.0.60.0110.04018.69
7.0.50.0280.04018.04
7.0.40.0140.03417.03
7.0.30.0120.03517.03
7.0.20.0130.03316.96
7.0.10.0150.03317.08
7.0.00.0160.02816.92
5.6.400.0060.00914.91
5.6.390.0000.01414.70
5.6.380.0070.00714.66
5.6.370.0120.00314.45
5.6.360.0120.00014.73
5.6.350.0070.00714.54
5.6.340.0030.00814.77
5.6.330.0070.00314.13
5.6.320.0040.01114.37
5.6.310.0080.00514.13
5.6.300.0070.00714.52
5.6.290.0070.00314.64
5.6.280.0020.04317.79
5.6.270.0030.01014.31
5.6.260.0000.00914.40
5.6.250.0150.00014.52
5.6.240.0030.01014.21
5.6.230.0030.01014.51
5.6.220.0000.01314.45
5.6.210.0100.03217.55
5.6.200.0130.03517.86
5.6.190.0180.04617.98
5.6.180.0130.03817.67
5.6.170.0170.03717.69
5.6.160.0170.04317.73
5.6.150.0130.03617.84
5.6.140.0200.03617.71
5.6.130.0140.04717.86
5.6.120.0080.04417.73
5.6.110.0220.04717.76
5.6.100.0050.04617.95
5.6.90.0210.03117.86
5.6.80.0140.03317.37
5.6.70.0200.04017.43
5.6.60.0230.04117.28
5.6.50.0110.03517.39
5.6.40.0130.03417.52
5.6.30.0100.03417.53
5.6.20.0120.03717.38
5.6.10.0130.03217.32
5.6.00.0180.02517.26
5.5.380.0100.00714.57
5.5.370.0050.00614.31
5.5.360.0030.01014.32
5.5.350.0060.04317.39
5.5.340.0100.04917.56
5.5.330.0220.04017.53
5.5.320.0250.03017.60
5.5.310.0080.04417.70
5.5.300.0070.04017.39
5.5.290.0230.02717.51
5.5.280.0190.03617.62
5.5.270.0140.03417.44
5.5.260.0160.03617.73
5.5.250.0180.04017.64
5.5.240.0130.04217.33
5.5.230.0160.03917.21
5.5.220.0210.03417.34
5.5.210.0110.03317.48
5.5.200.0130.03717.34
5.5.190.0320.03417.27
5.5.180.0100.03917.36
5.5.170.0100.00314.48
5.5.160.0100.03517.28
5.5.150.0150.03217.29
5.5.140.0150.03917.28
5.5.130.0230.03517.42
5.5.120.0130.02817.13
5.5.110.0100.03717.12
5.5.100.0130.02917.18
5.5.90.0110.03117.29
5.5.80.0110.03117.19
5.5.70.0130.03517.23
5.5.60.0140.03917.22
5.5.50.0120.03017.08
5.5.40.0160.02917.18
5.5.30.0100.03217.20
5.5.20.0130.03917.19
5.5.10.0050.04217.28
5.5.00.0100.04017.27

preferences:
58.05 ms | 401 KiB | 5 Q