3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Return domain name from url * For example: "all.ru" from "http://www.all.ru/test/test.html" * * @param $url * @param bool $with_www * @return string : domain name */ function get_domain($url, $with_www = false) { $url = preg_replace('#^https?://#', '', trim($url)); $path = explode ('/', $url); $domain = strtolower(trim($path[0])); $domain = preg_replace('#^www.#', '', $domain); if($with_www) { $domain = 'www.' . $domain; } return $domain; } /** * Format URL * * @param $url * @return string */ function format_url($url) { $parsed_url = parse_url($url); var_dump($parsed_url); $host = get_domain($parsed_url['host'], false); $path = preg_replace('#index\.[a-z]+#', '', $parsed_url['path']); $url = $host . $path; if (isset($parsed_url['query'])) { $url .= '?' . $parsed_url['query']; } return rtrim($url, '/'); } /** * Compare two formatted urls * * @param string $url_1 * @param string $url_2 * @return bool */ function compare_urls($url_1, $url_2) { return format_url($url_1) === format_url($url_2); } $url_1 = 'http://seos.bolseo.ru/index.php?module=2&siteID=235'; $url_2 = 'seos.bolseo.ru/?module=2&siteID=235'; var_dump(compare_urls($url_1, $url_2));

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.0100.00619.27
8.3.30.0080.00619.09
8.3.20.0040.00420.16
8.3.10.0030.00522.14
8.3.00.0080.00022.45
8.2.170.0090.01222.96
8.2.160.0040.01121.13
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0040.00417.75
8.2.110.0060.00322.13
8.2.100.0030.00919.89
8.2.90.0000.00819.17
8.2.80.0050.00319.78
8.2.70.0050.00317.88
8.2.60.0060.00317.93
8.2.50.0070.00318.07
8.2.40.0030.00618.16
8.2.30.0040.00418.17
8.2.20.0050.00218.01
8.2.10.0000.00817.93
8.2.00.0080.00018.04
8.1.270.0040.00422.16
8.1.260.0040.00426.35
8.1.250.0040.01128.09
8.1.240.0090.00023.88
8.1.230.0040.00719.06
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0030.00617.38
8.1.190.0000.00817.52
8.1.180.0040.00418.10
8.1.170.0060.00318.68
8.1.160.0050.00221.90
8.1.150.0050.00318.73
8.1.140.0030.00617.46
8.1.130.0030.00517.74
8.1.120.0050.00217.56
8.1.110.0070.00017.55
8.1.100.0040.00417.56
8.1.90.0040.00417.43
8.1.80.0040.00417.53
8.1.70.0030.00517.55
8.1.60.0030.00617.72
8.1.50.0000.00817.72
8.1.40.0080.00017.74
8.1.30.0030.00617.66
8.1.20.0080.00017.87
8.1.10.0090.00017.69
8.1.00.0000.00817.51
8.0.300.0040.00418.77
8.0.290.0000.00817.30
8.0.280.0040.00418.49
8.0.270.0040.00417.28
8.0.260.0070.00017.06
8.0.250.0030.00317.08
8.0.240.0030.00317.06
8.0.230.0000.00717.13
8.0.220.0070.00017.17
8.0.210.0030.00317.10
8.0.200.0030.00317.14
8.0.190.0000.00917.05
8.0.180.0000.00817.14
8.0.170.0000.00817.11
8.0.160.0040.00417.15
8.0.150.0040.00417.05
8.0.140.0050.00316.99
8.0.130.0030.00313.59
8.0.120.0040.00417.05
8.0.110.0040.00417.08
8.0.100.0000.00717.08
8.0.90.0040.00417.09
8.0.80.0030.01217.17
8.0.70.0080.00017.01
8.0.60.0050.00317.07
8.0.50.0000.00716.99
8.0.30.0130.01317.23
8.0.20.0100.01017.43
8.0.10.0040.00417.13
8.0.00.0080.01317.02
7.4.330.0060.00015.00
7.4.320.0060.00016.88
7.4.300.0000.00716.73
7.4.290.0000.00716.78
7.4.280.0040.00416.67
7.4.270.0080.00016.88
7.4.260.0070.00016.81
7.4.250.0080.00016.75
7.4.240.0040.00416.84
7.4.230.0070.00016.82
7.4.220.0030.01316.79
7.4.210.0110.00716.85
7.4.200.0030.00316.81
7.4.190.0020.00516.91
7.4.160.0130.00316.80
7.4.150.0110.00817.40
7.4.140.0150.00617.86
7.4.130.0030.02116.83
7.4.120.0070.01216.85
7.4.110.0100.00716.58
7.4.100.0140.01216.79
7.4.90.0060.01316.87
7.4.80.0080.01219.39
7.4.70.0130.00316.64
7.4.60.0080.00916.62
7.4.50.0050.00316.73
7.4.40.0130.00622.77
7.4.30.0080.00916.95
7.4.00.0070.00715.07
7.3.330.0000.00513.59
7.3.320.0000.00613.54
7.3.310.0050.00316.68
7.3.300.0000.00716.61
7.3.290.0090.00616.52
7.3.280.0100.00916.51
7.3.270.0030.01517.40
7.3.260.0030.01416.86
7.3.250.0120.00516.81
7.3.240.0130.00416.75
7.3.230.0070.01016.61
7.3.210.0130.01016.55
7.3.200.0070.01519.39
7.3.190.0070.01116.71
7.3.180.0030.01316.56
7.3.170.0030.01316.59
7.3.160.0060.01616.81
7.3.120.0060.00914.86
7.3.10.0130.00016.58
7.3.00.0070.00716.62
7.2.330.0100.01016.87
7.2.320.0140.01016.79
7.2.310.0070.01116.91
7.2.300.0060.01217.01
7.2.290.0030.01416.72
7.2.130.0070.00717.09
7.2.120.0000.01217.08
7.2.110.0030.01316.94
7.2.100.0030.01316.61
7.2.90.0040.00816.96
7.2.80.0000.01017.21
7.2.70.0000.01217.16
7.2.60.0060.00817.15
7.2.50.0030.00917.25
7.2.40.0000.01117.07
7.2.30.0070.00717.14
7.2.20.0050.00517.18
7.2.10.0100.00317.29
7.2.00.0040.00918.48
7.1.250.0110.00015.72
7.1.200.0050.00315.92
7.1.100.0060.00618.56
7.1.70.0040.00417.13
7.1.60.0070.01719.82
7.1.50.0120.01217.20
7.1.00.0030.07722.55
7.0.200.0060.00616.89
7.0.140.0070.07021.96
7.0.100.0130.07719.91
7.0.90.0030.08320.03
7.0.80.0030.08719.95
7.0.70.0370.04719.94
7.0.60.0030.04719.96
7.0.50.0170.09020.26
7.0.40.0100.04720.06
7.0.30.0070.08020.18
7.0.20.0030.09020.04
7.0.10.0070.03720.13
7.0.00.0070.06020.02
5.6.280.0000.07721.05
5.6.250.0100.08020.73
5.6.240.0070.07020.67
5.6.230.0100.05720.49
5.6.220.0100.08320.67
5.6.210.0030.07020.67
5.6.200.0070.06720.97
5.6.190.0100.09020.96
5.6.180.0100.03321.03
5.6.170.0130.07020.95
5.6.160.0000.08721.08
5.6.150.0030.04321.05
5.6.140.0030.03721.03
5.6.130.0030.07321.04
5.6.120.0100.08320.94
5.6.110.0200.06720.94
5.6.100.0200.07321.16
5.6.90.0130.08321.01
5.6.80.0000.08320.43
5.6.70.0100.07720.43
5.6.60.0070.07720.33
5.6.50.0070.06720.47
5.6.40.0100.07320.48
5.6.30.0130.04020.48
5.6.20.0070.08720.39
5.6.10.0100.06020.38
5.6.00.0070.08020.39
5.5.380.0100.08320.40
5.5.370.0130.08020.43
5.5.360.0100.04020.36
5.5.350.0070.08720.49
5.5.340.0030.07320.80
5.5.330.0200.07020.90
5.5.320.0130.06320.84
5.5.310.0170.07720.89
5.5.300.0030.05320.84
5.5.290.0030.03720.88
5.5.280.0130.07020.93
5.5.270.0100.06320.75
5.5.260.0230.05720.88
5.5.250.0000.06020.70
5.5.240.0070.07720.28
5.5.230.0070.05020.28
5.5.220.0100.08020.29
5.5.210.0030.07020.09
5.5.200.0100.05020.15
5.5.190.0100.04020.12
5.5.180.0000.04320.13
5.5.160.0100.07320.12
5.5.150.0170.05720.09
5.5.140.0100.05320.14
5.5.130.0030.08020.25
5.5.120.0100.06320.23
5.5.110.0070.07020.23
5.5.100.0130.06320.17
5.5.90.0000.05320.12
5.5.80.0030.06020.18
5.5.70.0030.04020.07
5.5.60.0130.06319.94
5.5.50.0130.06320.15
5.5.40.0100.04020.00
5.5.30.0030.05720.07
5.5.20.0000.05019.94
5.5.10.0030.08320.09
5.5.00.0030.04720.13
5.4.450.0030.04019.18
5.4.440.0030.08019.43
5.4.430.0030.05319.45
5.4.420.0100.07319.35
5.4.410.0100.07319.23
5.4.400.0100.04319.03
5.4.390.0100.07319.05
5.4.380.0030.05019.03
5.4.370.0070.06719.06
5.4.360.0000.08018.88
5.4.350.0200.03019.05
5.4.340.0100.07319.09
5.4.320.0070.07319.19
5.4.310.0170.03719.18
5.4.300.0030.06018.95
5.4.290.0070.06319.12
5.4.280.0100.07319.18
5.4.270.0130.03719.23
5.4.260.0130.07319.14
5.4.250.0000.05019.20
5.4.240.0070.06718.84
5.4.230.0130.07318.93
5.4.220.0030.08719.16
5.4.210.0030.04319.20
5.4.200.0130.07319.04
5.4.190.0100.06719.13
5.4.180.0030.04318.86
5.4.170.0070.07319.20
5.4.160.0030.07719.19
5.4.150.0070.03719.01
5.4.140.0000.04016.49
5.4.130.0100.05316.38
5.4.120.0070.04316.23
5.4.110.0100.07316.54
5.4.100.0030.07716.49
5.4.90.0070.06316.44
5.4.80.0030.04316.38
5.4.70.0100.04016.51
5.4.60.0070.07016.53
5.4.50.0100.05016.38
5.4.40.0030.04316.54
5.4.30.0100.07016.44
5.4.20.0030.07716.30
5.4.10.0100.06316.32
5.4.00.0070.04715.71
5.3.290.0070.04714.78
5.3.280.0170.02714.53
5.3.270.0170.06014.62
5.3.260.0100.04014.54
5.3.250.0100.05314.58
5.3.240.0070.04314.75
5.3.230.0070.05714.66
5.3.220.0070.07314.66
5.3.210.0030.05714.70
5.3.200.0030.05714.66
5.3.190.0170.06714.51
5.3.180.0070.07014.64
5.3.170.0100.06314.64
5.3.160.0070.06014.60
5.3.150.0170.07014.62
5.3.140.0000.05014.56
5.3.130.0000.06014.64
5.3.120.0030.05314.53
5.3.110.0100.05714.54
5.3.100.0000.04014.11
5.3.90.0030.04314.14
5.3.80.0100.05713.93
5.3.70.0130.07014.16
5.3.60.0030.07314.06
5.3.50.0100.04313.86
5.3.40.0030.08014.05
5.3.30.0030.07313.94
5.3.20.0070.06713.76
5.3.10.0100.06013.56
5.3.00.0070.06713.64
5.2.170.0030.04011.14
5.2.160.0100.04011.07
5.2.150.0070.05011.14
5.2.140.0030.06011.21
5.2.130.0100.06011.03
5.2.120.0000.03711.04
5.2.110.0100.04011.14
5.2.100.0070.06011.04
5.2.90.0100.02011.20
5.2.80.0030.06711.21
5.2.70.0100.05711.01
5.2.60.0000.06010.99
5.2.50.0030.04310.93
5.2.40.0030.04011.08
5.2.30.0030.05311.01
5.2.20.0170.04711.09
5.2.10.0100.04311.00
5.2.00.0000.05310.79
5.1.60.0030.03310.09
5.1.50.0000.05010.09
5.1.40.0030.02310.10
5.1.30.0030.03010.21
5.1.20.0000.03710.31
5.1.10.0100.02310.16
5.1.00.0070.02010.19
5.0.50.0030.0208.64
5.0.40.0030.0308.54
5.0.30.0030.0278.30
5.0.20.0070.0438.22
5.0.10.0070.0338.25
5.0.00.0070.0538.29
4.4.90.0070.0338.00
4.4.80.0000.0338.00
4.4.70.0030.0308.00
4.4.60.0000.0208.00
4.4.50.0030.0308.00
4.4.40.0100.0178.00
4.4.30.0030.0308.00
4.4.20.0000.0378.00
4.4.10.0070.0108.00
4.4.00.0030.0278.00
4.3.110.0030.0108.00
4.3.100.0030.0138.00
4.3.90.0030.0338.00
4.3.80.0000.0508.00
4.3.70.0070.0178.00
4.3.60.0030.0308.00
4.3.50.0000.0378.00
4.3.40.0000.0308.00
4.3.30.0000.0308.00
4.3.20.0000.0238.00
4.3.10.0000.0138.00
4.3.00.0000.0208.00

preferences:
47.2 ms | 400 KiB | 5 Q