3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace PortlandLabs\DomainMapper\Url; use Concrete\Core\Url\Components\Path; use Concrete\Core\Url\Resolver\PathUrlResolver; use Concrete\Core\Url\Resolver\UrlResolverInterface; use PortlandLabs\DomainMapper\Map\DomainMap; /** * Class Resolver * URL Resolver for handling domain mapped urls, this will intercept mapped paths and alter the outputted links to * remove the prefix and set the proper host. * * @package PortlandLabs\DomainMapper\Url */ class Resolver implements UrlResolverInterface { public function resolve(array $arguments, $resolved = null) { $args = $arguments; $path = array_shift($args); /** @var DomainMap $map */ $map = \Core::make('domain_mapper/config_map'); if ($path instanceof \Page) { $path = $path->getCollectionPath(); $arguments[0] = $path; } if (is_scalar($path) && $path) { $path = (string)$path; $resolved_url = $resolved; if (!$resolved) { /** @var PathUrlResolver $path_resolver */ $path_resolver = \URL::getResolver('concrete.path'); $resolved_url = $path_resolver->resolve($arguments); } $url = $resolved_url; if ($url) { if ($prefix = $map->getPath($url->getHost())) { $prefix_path = new Path($prefix); $real_path = $url->getPath(); if (substr(strtolower($real_path), 0, strlen($prefix_path)) === strtolower($prefix_path)) { $relative_path = $real_path->getRelativePath($prefix_path); $url = $url->setPath($relative_path); } else { $url = $url->setHost(\Config::get('concrete.seo.canonical_host')); } return $url; } if ($domain = $map->getDomain($url->getPath())) { $map_path = new Path(rtrim($map->getPath($domain), '/')); $url_path = new Path(rtrim($url->getPath(), '/')); foreach ($map_path->toArray() as $key => $path_node) { $url_path->offsetUnset($key); } $url = $url->setPath($url_path); $url = $url->setHost($domain); return $url; } } } return $resolved; } }

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.40.0040.01118.79
8.3.30.0080.00818.85
8.3.20.0060.00320.39
8.3.10.0000.00821.85
8.3.00.0040.00420.34
8.2.170.0090.00922.96
8.2.160.0060.01122.30
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0030.00617.50
8.2.110.0030.00622.25
8.2.100.0090.00319.35
8.2.90.0040.00419.02
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0080.00017.93
8.2.50.0050.00318.07
8.2.40.0000.00819.29
8.2.30.0020.00520.52
8.2.20.0040.00417.84
8.2.10.0040.00418.10
8.2.00.0000.00718.15
8.1.270.0070.00723.91
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0030.00622.53
8.1.230.0040.00717.48
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.25
8.1.180.0000.00718.10
8.1.170.0000.00818.73
8.1.160.0040.00422.12
8.1.150.0070.00018.87
8.1.140.0080.00017.35
8.1.130.0040.00417.69
8.1.120.0070.00017.33
8.1.110.0000.00717.44
8.1.100.0040.00417.48
8.1.90.0050.00217.47
8.1.80.0000.00717.37
8.1.70.0070.00017.39
8.1.60.0040.00417.59
8.1.50.0040.00417.54
8.1.40.0100.00017.48
8.1.30.0060.00317.59
8.1.20.0050.00317.66
8.1.10.0000.00717.60
8.1.00.0050.00317.51
8.0.300.0080.00018.77
8.0.290.0000.00716.88
8.0.280.0040.00418.54
8.0.270.0030.00617.21
8.0.260.0000.00617.29
8.0.250.0020.00517.06
8.0.240.0050.00317.03
8.0.230.0030.00317.06
8.0.220.0030.00316.88
8.0.210.0070.00016.98
8.0.200.0030.00317.10
8.0.190.0030.00517.11
8.0.180.0090.00017.00
8.0.170.0060.00317.02
8.0.160.0040.00417.07
8.0.150.0030.00316.84
8.0.140.0000.00716.86
8.0.130.0030.00313.44
8.0.120.0060.00316.98
8.0.110.0020.00516.83
8.0.100.0080.00017.02
8.0.90.0040.00417.03
8.0.80.0000.01517.03
8.0.70.0040.00416.89
8.0.60.0040.00416.85
8.0.50.0000.00716.96
8.0.30.0080.01117.10
8.0.20.0100.01017.40
8.0.10.0000.00717.07
8.0.00.0110.00616.73
7.4.330.0000.00515.13
7.4.320.0060.00016.52
7.4.300.0000.00616.57
7.4.290.0000.00816.34
7.4.280.0040.00416.56
7.4.270.0030.00316.59
7.4.260.0000.00716.64
7.4.250.0000.00716.57
7.4.240.0010.00616.54
7.4.230.0000.00716.61
7.4.220.0130.00616.51
7.4.210.0100.00716.59
7.4.200.0000.00716.65
7.4.160.0120.00416.70
7.4.150.0170.00017.40
7.4.140.0150.00317.86
7.4.130.0080.01016.52
7.4.120.0090.00916.60
7.4.110.0180.00316.57
7.4.100.0190.00316.30
7.4.90.0140.00316.59
7.4.80.0130.00319.39
7.4.70.0070.01016.58
7.4.60.0100.00716.60
7.4.50.0090.00016.40
7.4.40.0040.01316.61
7.4.30.0070.01416.62
7.4.10.0100.01014.80
7.4.00.0090.00915.03
7.3.330.0000.00513.26
7.3.320.0050.00013.20
7.3.310.0000.00716.38
7.3.300.0070.00016.16
7.3.290.0080.01016.31
7.3.280.0060.01216.29
7.3.270.0130.00317.40
7.3.260.0130.00616.49
7.3.250.0110.00516.45
7.3.240.0160.00816.24
7.3.230.0070.01116.39
7.3.210.0140.00416.56
7.3.200.0090.00916.37
7.3.190.0030.01316.42
7.3.180.0090.00616.38
7.3.170.0120.00916.41
7.3.160.0100.01316.32
7.3.130.0100.01015.01
7.3.120.0080.00914.68
7.3.110.0050.01114.74
7.3.100.0060.00914.93
7.3.90.0040.01014.78
7.3.80.0060.00714.77
7.3.70.0030.01114.78
7.3.60.0070.00714.74
7.3.50.0070.00614.58
7.3.40.0050.00514.77
7.3.30.0080.00414.67
7.3.20.0040.01116.61
7.3.10.0030.01016.54
7.3.00.0020.01216.55
7.2.330.0040.01416.26
7.2.320.0150.00916.64
7.2.310.0080.00816.65
7.2.300.0100.01016.69
7.2.290.0070.01416.38
7.2.260.0110.00714.53
7.2.250.0050.01115.14
7.2.240.0050.00814.88
7.2.230.0040.01114.81
7.2.220.0020.01414.97
7.2.210.0040.00814.97
7.2.200.0090.00614.95
7.2.190.0030.01115.07
7.2.180.0080.00614.72
7.2.170.0070.00714.92
7.2.160.0080.00914.75
7.2.150.0070.00916.84
7.2.140.0080.00816.73
7.2.130.0050.00916.86
7.2.120.0080.00816.78
7.2.110.0020.01016.84
7.2.100.0060.00816.56
7.2.90.0070.00816.86
7.2.80.0070.00616.50
7.2.70.0060.00716.58
7.2.60.0170.00516.68
7.2.50.0050.01016.75
7.2.40.0050.01316.69
7.2.30.0090.00816.71
7.2.20.0050.00816.72
7.2.10.0050.00816.88
7.2.00.0050.01317.41
7.1.330.0070.00715.52
7.1.320.0060.00715.67
7.1.310.0060.00815.73
7.1.300.0060.00615.75
7.1.290.0050.00915.62
7.1.280.0080.00515.70
7.1.270.0050.00915.63
7.1.260.0010.01115.73
7.1.250.0050.00615.41
7.1.240.0030.00615.64
7.1.230.0030.00615.56
7.1.220.0040.00715.48
7.1.210.0060.00315.63
7.1.200.0000.01215.60
7.1.190.0030.01015.70
7.1.180.0060.00615.73
7.1.170.0060.00315.80
7.1.160.0030.01015.50
7.1.150.0030.00615.65
7.1.140.0030.00715.45
7.1.130.0060.00615.48
7.1.120.0040.01115.63
7.1.110.0040.00715.76
7.1.100.0040.00716.98
7.1.90.0000.01515.72
7.1.80.0100.00315.60
7.1.70.0070.00316.16
7.1.60.0090.00917.47
7.1.50.0130.00516.22
7.1.40.0030.01015.82
7.1.30.0060.00615.60
7.1.20.0070.00715.77
7.1.10.0030.01015.66
7.1.00.0060.04218.95
7.0.330.0070.00715.31
7.0.320.0040.00815.16
7.0.310.0030.01115.38
7.0.300.0030.00915.27
7.0.290.0060.00915.15
7.0.280.0040.00415.43
7.0.270.0040.00815.13
7.0.260.0040.00715.28
7.0.250.0070.00715.27
7.0.240.0030.01015.14
7.0.230.0030.01015.13
7.0.220.0040.00415.27
7.0.210.0090.00415.30
7.0.200.0050.00416.05
7.0.190.0030.01015.43
7.0.180.0070.00415.43
7.0.170.0060.00615.32
7.0.160.0040.01115.04
7.0.150.0080.00015.49
7.0.140.0060.00315.16
7.0.130.0000.01315.22
7.0.120.0030.00615.16
7.0.110.0030.01115.39
7.0.100.0090.00615.13
7.0.90.0030.00915.29
7.0.80.0070.01014.96
7.0.70.0040.01115.26
7.0.60.0050.05017.71
7.0.50.0000.03216.49
7.0.40.0090.02916.83
7.0.30.0280.02816.69
7.0.20.0160.02216.85
7.0.10.0100.02816.72
7.0.00.0100.04316.70
5.6.400.0000.00914.20
5.6.390.0040.01114.40
5.6.380.0040.01114.03
5.6.370.0030.00614.25
5.6.360.0060.00914.21
5.6.350.0140.00014.43
5.6.340.0040.01114.32
5.6.330.0000.01414.08
5.6.320.0120.00314.29
5.6.310.0040.01214.05
5.6.300.0080.00814.05
5.6.290.0070.00313.97
5.6.280.0030.04017.36
5.6.270.0130.00014.17
5.6.260.0060.01014.06
5.6.250.0060.01314.04
5.6.240.0100.00713.92
5.6.230.0090.00914.14
5.6.220.0090.00313.98
5.6.210.0080.04317.56
5.6.200.0120.02316.29
5.6.190.0070.02717.29
5.6.180.0200.04417.39
5.6.170.0130.04617.44
5.6.160.0050.03817.31
5.6.150.0050.02816.18
5.6.140.0060.02516.29
5.6.130.0060.04516.18
5.6.120.0090.02817.53
5.6.110.0020.02717.62
5.6.100.0070.03617.75
5.6.90.0120.02017.56
5.6.80.0100.04117.33
5.6.70.0000.00914.15
5.6.60.0000.01413.92
5.6.50.0040.00414.02
5.6.40.0030.01313.99
5.6.30.0110.00413.89
5.6.20.0140.00014.19
5.6.10.0070.00714.04
5.6.00.0030.00613.98
5.5.380.0120.00614.25
5.5.370.0030.00613.75
5.5.360.0000.01914.14
5.5.350.0030.04917.37
5.5.340.0030.02315.89
5.5.330.0110.03317.10
5.5.320.1840.02617.14
5.5.310.0180.04016.97
5.5.300.0080.04015.92
5.5.290.0020.02716.16
5.5.280.0020.03317.34
5.5.270.0100.03617.29
5.5.260.0020.04817.45
5.5.250.0020.02417.19
5.5.240.0150.04217.24
5.5.230.0030.00614.07
5.5.220.0040.00814.01
5.5.210.0090.00614.08
5.5.200.0100.00313.79
5.5.190.0030.01314.03
5.5.180.0040.00814.03
5.5.170.0070.00714.21
5.5.160.0090.00613.73
5.5.150.0000.01013.81
5.5.140.0000.00814.15
5.5.130.0070.01313.88
5.5.120.0000.01313.99
5.5.110.0090.00613.81
5.5.100.0090.00614.01
5.5.90.0030.01313.86
5.5.80.0040.01114.00
5.5.70.0030.01213.94
5.5.60.0090.00614.25
5.5.50.0060.00913.89
5.5.40.0120.00614.05
5.5.30.0000.01314.21
5.5.20.0040.00714.05
5.5.10.0030.01013.61
5.5.00.0060.01013.93
5.4.450.0400.03015.30
5.4.440.0450.02615.38
5.4.430.0420.02915.29
5.4.420.0650.03015.37
5.4.410.0500.02915.25
5.4.400.0520.02814.98
5.4.390.0520.02915.13
5.4.380.0600.02015.12
5.4.370.0480.03415.16
5.4.360.0670.03315.17
5.4.350.0470.03515.05
5.4.340.0550.03315.25
5.4.330.0080.00311.12
5.4.320.0650.03215.14
5.4.310.0500.02815.20
5.4.300.0550.02515.25
5.4.290.0540.02715.05
5.4.280.0500.03014.99
5.4.270.0450.03515.17
5.4.260.0570.02315.13
5.4.250.0480.03215.24
5.4.240.0530.03115.06
5.4.230.0500.03315.13
5.4.220.0680.04115.06
5.4.210.0650.03515.06
5.4.200.0670.04315.21
5.4.190.0680.02815.20
5.4.180.0600.02715.13
5.4.170.0540.03114.98
5.4.160.0630.02515.12
5.4.150.0580.03215.16
5.4.140.0550.03013.78
5.4.130.0770.02313.78
5.4.120.0550.02713.77
5.4.110.0480.03413.80
5.4.100.0380.02813.85
5.4.90.0390.02713.87
5.4.80.0450.03213.87
5.4.70.0180.03513.76
5.4.60.0110.02313.70
5.4.50.0050.03513.80
5.4.40.0120.02513.78
5.4.30.0150.03713.68
5.4.20.0030.03013.78
5.4.10.0000.01011.12
5.4.00.0000.00711.12

preferences:
54.93 ms | 400 KiB | 5 Q